fix next_char
This commit is contained in:
parent
27bfbe6ef4
commit
6c163d8eb0
1 changed files with 3 additions and 5 deletions
8
regex.c
8
regex.c
|
@ -73,14 +73,12 @@ char *next_char(char *needle)
|
||||||
int db;
|
int db;
|
||||||
if (*needle && *needle != '[')
|
if (*needle && *needle != '[')
|
||||||
return needle + 1;
|
return needle + 1;
|
||||||
for (db = (*needle == '[' ? 2 : 0);
|
for (db = 1;
|
||||||
*needle && (*needle != ']' || db);
|
*needle && (*needle != ']' || db);
|
||||||
needle++)
|
needle++)
|
||||||
{
|
if (db)
|
||||||
if (db > 1)
|
|
||||||
db--;
|
db--;
|
||||||
}
|
return needle + 1;
|
||||||
return needle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find first character behind the closing parenthesis of the current group, or end of string
|
// Find first character behind the closing parenthesis of the current group, or end of string
|
||||||
|
|
Loading…
Reference in a new issue