1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

Check for double quotes in the buildcommand.

This commit is contained in:
Alain Magloire 2003-01-24 20:40:05 +00:00
parent 3fbb451d18
commit f50d5032a3

View file

@ -74,14 +74,15 @@ public class SettingsBlock implements IWizardTab {
useDefaultBuildCmd = nature.isDefaultBuildCmd();
if (!useDefaultBuildCmd) {
buildCmd = nature.getBuildCommand().toOSString();
if (buildCmd.indexOf(' ') > 0) {
buildCmd = "\"" + buildCmd + "\"";
}
buildCmd += " " + nature.getFullBuildArguments();
}
}
} catch (CoreException e) {
}
catch (CoreException e) {
}
}
else {
} else {
// FIXME: Should use the default settings
stopOnError = false;
useDefaultBuildCmd = true;
@ -197,17 +198,24 @@ public class SettingsBlock implements IWizardTab {
nature.setBuildCommandOverride(useDefaultBuildCmd());
if (!useDefaultBuildCmd()) {
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;
if ( start == -1 ) {
if (end == -1) {
path = new Path(bldLine);
} else {
path = new Path(bldLine.substring(0, start));
path = new Path(bldLine.substring(start, end));
}
nature.setBuildCommand(path, new SubProgressMonitor(monitor, 50));
String args = "";
if ( start != -1 ) {
args = bldLine.substring(start + 1);
if (end != -1) {
args = bldLine.substring(end + 1);
}
nature.setFullBuildArguments(args, new SubProgressMonitor(monitor, 50));
}