From f50d5032a3a929e7707eda2a23c475f0a368805e Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Fri, 24 Jan 2003 20:40:05 +0000 Subject: [PATCH] Check for double quotes in the buildcommand. --- .../eclipse/cdt/ui/wizards/SettingsBlock.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/SettingsBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/SettingsBlock.java index f6292eee0c0..e81a52c4539 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/SettingsBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/SettingsBlock.java @@ -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)); }