1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

StringIndexBufferException corrected.

This commit is contained in:
Alain Magloire 2003-10-03 19:59:07 +00:00
parent 0e11088e84
commit 4882849b8c

View file

@ -95,15 +95,18 @@ public abstract class Conditional extends Parent implements IConditional {
// Find the end of the first string. // Find the end of the first string.
int count = 0; int count = 0;
// For the (ARG1, ARG2) format. // For the (ARG1, ARG2) format.
// get the first ARG1
if (terminal == ',') { if (terminal == ',') {
int paren = 0; int paren = 0;
for (count = 0; count < line.length(); count++) { for (count = 1; count < line.length(); count++) {
char ch = line.charAt(count); char ch = line.charAt(count);
if (ch == '(') { if (ch == '(') {
paren++; paren++;
} else if (ch == ')') { } else if (ch == ')') {
paren--; paren--;
} else if (ch == terminal && paren <= 0) { }
if (ch == terminal && paren <= 0) {
break; break;
} }
} }
@ -136,7 +139,8 @@ public abstract class Conditional extends Parent implements IConditional {
paren++; paren++;
} else if (ch == ')') { } else if (ch == ')') {
paren--; paren--;
} else if (ch == terminal && paren <= 0) { }
if (ch == terminal && paren <= 0) {
break; break;
} }
} }
@ -147,6 +151,6 @@ public abstract class Conditional extends Parent implements IConditional {
} }
} }
} }
arg2 = line.substring(1, count); arg2 = line.substring(0, count);
} }
} }