1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Fix for bug 44082 - Managed Make: browse to include path "C:\like\this"

This commit is contained in:
Sean Evoy 2004-05-13 19:38:45 +00:00
parent 4debf40704
commit c70cea46dc

View file

@ -491,19 +491,18 @@ public class FileListControl {
input = dialog.getValue(); input = dialog.getValue();
} }
// Double-quote the spaces in paths (if any) // Double-quote the spaces or backslashes in paths (if any)
if (input != null && input.length() > 0) { if (input != null && input.length() > 0) {
switch (browseType) { if (browseType == IOption.BROWSE_DIR ||
case IOption.BROWSE_DIR: browseType == IOption.BROWSE_FILE) {
case IOption.BROWSE_FILE: // Check for spaces
String[] segments = input.split("\\s"); //$NON-NLS-1$ int firstWhitespace = input.indexOf("\\s"); //$NON-NLS-1$
if (segments.length > 1) { int firstBackslash = input.indexOf("\\"); //$NON-NLS-1$
// String[] segments = input.split("\\s"); //$NON-NLS-1$
if (firstWhitespace != -1 || firstBackslash != -1) {
// Double-quote paths with whitespaces // Double-quote paths with whitespaces
input = "\"" + input + "\""; //$NON-NLS-1$ //$NON-NLS-2$ input = "\"" + input + "\""; //$NON-NLS-1$ //$NON-NLS-2$
} }
break;
default:
break;
} }
} }