fix fix
This commit is contained in:
parent
25cb4747b8
commit
72e80721e8
7
main.cpp
7
main.cpp
@ -149,18 +149,21 @@ Substring readBrackets(Substring &input, const char * brackets) {
|
||||
return Substring();
|
||||
}
|
||||
|
||||
input.start++;
|
||||
|
||||
int depth = 1;
|
||||
Substring result(input.start, input.start);
|
||||
|
||||
while(depth > 0 && input.size() > 0) {
|
||||
result.end = ++input.start;
|
||||
|
||||
if (*input.start == brackets[0]) {
|
||||
depth++;
|
||||
}
|
||||
if (*input.start == brackets[1]) {
|
||||
depth--;
|
||||
|
||||
if(depth==0) break;
|
||||
}
|
||||
result.end = ++input.start;
|
||||
}
|
||||
// advance beyond last bracket
|
||||
if (input.size())
|
||||
|
Loading…
Reference in New Issue
Block a user