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:
parent
96a8f08969
commit
6d19eaab8b
1 changed files with 9 additions and 7 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue