Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorOleg Krasilnikov2008-03-12 15:49:25 +0000
committerOleg Krasilnikov2008-03-12 15:49:25 +0000
commit6d19eaab8bc0b43488ae773edbf295a06ab95e4d (patch)
tree981af0624ef4dd8b9d918353acd5bc3af4330289 /build
parent96a8f08969a117e5dfca36320391c92e738b0f2e (diff)
downloadorg.eclipse.cdt-6d19eaab8bc0b43488ae773edbf295a06ab95e4d.tar.gz
org.eclipse.cdt-6d19eaab8bc0b43488ae773edbf295a06ab95e4d.tar.xz
org.eclipse.cdt-6d19eaab8bc0b43488ae773edbf295a06ab95e4d.zip
Bug #222390 : Overriding make variables in build command does not accept quotes
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
index b0e45b84b41..b0fc4662ce1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
@@ -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,10 +2070,10 @@ public class CommonBuilder extends ACBuilder {
aList.add(str);
}
}
-// aList.add(buffer.toString());
- buffer = new StringBuffer();
+ buffer = new StringBuilder();
} else {
- buffer.append(c);
+ if (needsToAdd)
+ buffer.append(c);
}
}
if (buffer.length() > 0){
@@ -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 {

Back to the top