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

Bug #222390 : Overriding make variables in build command does not accept quotes

This commit is contained in:
Oleg Krasilnikov 2008-03-12 15:49:25 +00:00
parent 96a8f08969
commit 6d19eaab8b

View file

@ -2046,19 +2046,21 @@ public class CommonBuilder extends ACBuilder {
}
// Turn the string into an array.
String[] makeArray(String string) {
private String[] makeArray(String string) {
string = string.trim();
char[] array = string.toCharArray();
ArrayList aList = new ArrayList();
StringBuffer buffer = new StringBuffer();
ArrayList<String> aList = new ArrayList<String>();
StringBuilder buffer = new StringBuilder();
boolean inComment = false;
for (int i = 0; i < array.length; i++) {
char c = array[i];
boolean needsToAdd = true;
if (array[i] == '"' || array[i] == '\'') {
if (i > 0 && array[i - 1] == '\\') {
inComment = false;
} else {
inComment = !inComment;
needsToAdd = false; // skip it
}
}
if (c == ' ' && !inComment) {
@ -2068,9 +2070,9 @@ public class CommonBuilder extends ACBuilder {
aList.add(str);
}
}
// aList.add(buffer.toString());
buffer = new StringBuffer();
buffer = new StringBuilder();
} else {
if (needsToAdd)
buffer.append(c);
}
}
@ -2080,7 +2082,7 @@ public class CommonBuilder extends ACBuilder {
aList.add(str);
}
}
return (String[]) aList.toArray(new String[aList.size()]);
return aList.toArray(new String[aList.size()]);
}
private void removeAllMarkers(IProject currProject) throws CoreException {