Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorDavid Inglis2004-10-05 19:50:17 -0400
committerDavid Inglis2004-10-05 19:50:17 -0400
commit83c6521896bf556682368576856d7161a1f21209 (patch)
tree5e68b3ec9e5655e33e38bbd540b472d524824e56 /build
parent5bd3694555666c967f03e1bdd1b5cf43c89e5f15 (diff)
downloadorg.eclipse.cdt-83c6521896bf556682368576856d7161a1f21209.tar.gz
org.eclipse.cdt-83c6521896bf556682368576856d7161a1f21209.tar.xz
org.eclipse.cdt-83c6521896bf556682368576856d7161a1f21209.zip
fixed bug #75685
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java
index 29363a49ada..654972be8bf 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java
@@ -235,12 +235,14 @@ public class BuildInfoFactory {
protected Map decodeMap(String value) {
Map map = new HashMap();
StringBuffer envStr = new StringBuffer(value);
+ String escapeChars = "|\\";
+ char escapeChar = '\\';
try {
while (envStr.length() > 0) {
int ndx = 0;
while (ndx < envStr.length() ) {
- if (envStr.charAt(ndx) == '|') {
- if (envStr.charAt(ndx - 1) == '\\') { // escaped '|' - remove '\' and continue on.
+ if (escapeChars.indexOf(envStr.charAt(ndx)) != -1) {
+ if (envStr.charAt(ndx - 1) == escapeChar) { // escaped '|' - remove '\' and continue on.
envStr.deleteCharAt(ndx - 1);
} else {
break;
@@ -252,7 +254,7 @@ public class BuildInfoFactory {
int lndx = 0;
while (lndx < line.length() ) {
if (line.charAt(lndx) == '=') {
- if (line.charAt(lndx - 1) == '\\') { // escaped '=' - remove '\' and continue on.
+ if (line.charAt(lndx - 1) == escapeChar) { // escaped '=' - remove '\' and continue on.
line.deleteCharAt(lndx - 1);
} else {
break;
@@ -273,19 +275,19 @@ public class BuildInfoFactory {
Iterator entries = values.entrySet().iterator();
while (entries.hasNext()) {
Entry entry = (Entry) entries.next();
- str.append(escapeChars((String) entry.getKey(), "=|")); //$NON-NLS-1$
+ str.append(escapeChars((String) entry.getKey(), "=|\\", '\\')); //$NON-NLS-1$
str.append("="); //$NON-NLS-1$
- str.append(escapeChars((String) entry.getValue(), "|")); //$NON-NLS-1$
+ str.append(escapeChars((String) entry.getValue(), "|\\", '\\')); //$NON-NLS-1$
str.append("|"); //$NON-NLS-1$
}
return str.toString();
}
- protected String escapeChars(String string, String escapeChars) {
+ protected String escapeChars(String string, String escapeChars, char escapeChar) {
StringBuffer str = new StringBuffer(string);
for(int i = 0; i < str.length(); i++) {
- if ( escapeChars.indexOf(str.charAt(i)) != -1 ) {
- str.insert(i, '\\');
+ if ( escapeChars.indexOf(str.charAt(i)) != -1) {
+ str.insert(i, escapeChar);
i++;
}
}

Back to the top