Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2013-04-23 18:41:09 -0400
committerJeff Johnston2013-04-23 18:51:33 -0400
commit890eea5813bb961b2c562737f366f9ea6dfcb075 (patch)
tree342db6556df9a35bf0a16ad5e189d69ad6cfce47 /build/org.eclipse.cdt.autotools.core/src
parent29c5392beea9a8dff7faefebdbc713aef23c265d (diff)
downloadorg.eclipse.cdt-890eea5813bb961b2c562737f366f9ea6dfcb075.tar.gz
org.eclipse.cdt-890eea5813bb961b2c562737f366f9ea6dfcb075.tar.xz
org.eclipse.cdt-890eea5813bb961b2c562737f366f9ea6dfcb075.zip
Bug 403946: Autotools configure does not handle round brackets in
workspace name - Add backslashes to special characters such as round brackets when computing the command path. Change-Id: I3bf0d78fc8e0a94c6287a7fae00a469ecdad6dc1 Reviewed-on: https://git.eclipse.org/r/11921 Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> IP-Clean: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
Diffstat (limited to 'build/org.eclipse.cdt.autotools.core/src')
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
index 7ee53d262f..19ce6a231c 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
@@ -853,6 +853,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
ConsoleOutputStream consoleOutStream = null;
+ ErrorParserManager epm = null;
StringBuffer buf = new StringBuffer();
// Launch command - main invocation
@@ -891,7 +892,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Hook up an error parser manager
URI uri = URIUtil.toURI(runPath);
- ErrorParserManager epm = new ErrorParserManager(project, uri, this, new String[] {ErrorParser.ID});
+ epm = new ErrorParserManager(project, uri, this, new String[] {ErrorParser.ID});
epm.setOutputStream(consoleOutStream);
epm.addErrorParser(ErrorParser.ID, new ErrorParser(getSourcePath(), getBuildPath()));
@@ -968,13 +969,17 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Write message on the console
consoleOutStream.write(buf.toString().getBytes());
consoleOutStream.flush();
+
// // Generate any error markers that the build has discovered
// monitor.subTask(ManagedMakeMessages
// .getResourceString(MARKERS));
// epm.reportProblems();
} finally {
- consoleOutStream.close();
+ if (consoleOutStream != null)
+ consoleOutStream.close();
+ if (epm != null)
+ epm.close();
}
// If we have an error and no specific error markers, use the default error marker.
@@ -1009,6 +1014,8 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Get the path string. We add a Win check to handle MingW.
// For MingW, we would rather represent C:\a\b as /C/a/b which
// doesn't cause Makefile to choke. For Cygwin we use /cygdrive/C/a/b
+ // Add backslashes to escape any special characters in the command path
+ // that will give the shell distress (e.g. runtime-New_Configuration(1)).
private String getPathString(IPath path) {
String s = path.toString();
if (Platform.getOS().equals(Platform.OS_WIN32)) {
@@ -1018,6 +1025,9 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
s = s.replaceAll("^([A-Z])(:)", "/$1");
}
}
+ s = s.replaceAll("\\\\", "\\\\\\\\");
+ s = s.replaceAll("\\(", "\\\\(");
+ s = s.replaceAll("\\)", "\\\\)");
return s;
}
@@ -1091,6 +1101,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
ConsoleOutputStream consoleOutStream = null;
+ ErrorParserManager epm = null;
StringBuffer buf = new StringBuffer();
// Launch command - main invocation
@@ -1149,7 +1160,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Hook up an error parser manager
URI uri = URIUtil.toURI(runPath);
- ErrorParserManager epm = new ErrorParserManager(project, uri, this, new String[] {ErrorParser.ID});
+ epm = new ErrorParserManager(project, uri, this, new String[] {ErrorParser.ID});
epm.setOutputStream(consoleOutStream);
epm.addErrorParser(ErrorParser.ID, new ErrorParser(getSourcePath(), getBuildPath()));
@@ -1233,7 +1244,10 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// .getResourceString(MARKERS));
// epm.reportProblems();
} finally {
- consoleOutStream.close();
+ if (consoleOutStream != null)
+ consoleOutStream.close();
+ if (epm != null)
+ epm.close();
}
// If we have an error and no specific error markers, use the default error marker.

Back to the top