mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
Check for double quotes in the buildcommand.
This commit is contained in:
parent
3fbb451d18
commit
f50d5032a3
1 changed files with 17 additions and 9 deletions
|
@ -74,14 +74,15 @@ public class SettingsBlock implements IWizardTab {
|
||||||
useDefaultBuildCmd = nature.isDefaultBuildCmd();
|
useDefaultBuildCmd = nature.isDefaultBuildCmd();
|
||||||
if (!useDefaultBuildCmd) {
|
if (!useDefaultBuildCmd) {
|
||||||
buildCmd = nature.getBuildCommand().toOSString();
|
buildCmd = nature.getBuildCommand().toOSString();
|
||||||
|
if (buildCmd.indexOf(' ') > 0) {
|
||||||
|
buildCmd = "\"" + buildCmd + "\"";
|
||||||
|
}
|
||||||
buildCmd += " " + nature.getFullBuildArguments();
|
buildCmd += " " + nature.getFullBuildArguments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
}
|
}
|
||||||
catch (CoreException e) {
|
} else {
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// FIXME: Should use the default settings
|
// FIXME: Should use the default settings
|
||||||
stopOnError = false;
|
stopOnError = false;
|
||||||
useDefaultBuildCmd = true;
|
useDefaultBuildCmd = true;
|
||||||
|
@ -197,17 +198,24 @@ public class SettingsBlock implements IWizardTab {
|
||||||
nature.setBuildCommandOverride(useDefaultBuildCmd());
|
nature.setBuildCommandOverride(useDefaultBuildCmd());
|
||||||
if (!useDefaultBuildCmd()) {
|
if (!useDefaultBuildCmd()) {
|
||||||
String bldLine = getBuildLine();
|
String bldLine = getBuildLine();
|
||||||
int start = bldLine.indexOf(' ');
|
int start = 0;
|
||||||
|
int end = -1;
|
||||||
|
if (!bldLine.startsWith("\"")) {
|
||||||
|
end = bldLine.indexOf(' ');
|
||||||
|
} else {
|
||||||
|
start = 1;
|
||||||
|
end = bldLine.indexOf('"', 1);
|
||||||
|
}
|
||||||
IPath path;
|
IPath path;
|
||||||
if ( start == -1 ) {
|
if (end == -1) {
|
||||||
path = new Path(bldLine);
|
path = new Path(bldLine);
|
||||||
} else {
|
} else {
|
||||||
path = new Path(bldLine.substring(0, start));
|
path = new Path(bldLine.substring(start, end));
|
||||||
}
|
}
|
||||||
nature.setBuildCommand(path, new SubProgressMonitor(monitor, 50));
|
nature.setBuildCommand(path, new SubProgressMonitor(monitor, 50));
|
||||||
String args = "";
|
String args = "";
|
||||||
if ( start != -1 ) {
|
if (end != -1) {
|
||||||
args = bldLine.substring(start + 1);
|
args = bldLine.substring(end + 1);
|
||||||
}
|
}
|
||||||
nature.setFullBuildArguments(args, new SubProgressMonitor(monitor, 50));
|
nature.setFullBuildArguments(args, new SubProgressMonitor(monitor, 50));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue