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;
|
||||
if (*needle && *needle != '[')
|
||||
return needle + 1;
|
||||
for (db = (*needle == '[' ? 2 : 0);
|
||||
for (db = 1;
|
||||
*needle && (*needle != ']' || db);
|
||||
needle++)
|
||||
{
|
||||
if (db > 1)
|
||||
if (db)
|
||||
db--;
|
||||
}
|
||||
return needle;
|
||||
return needle + 1;
|
||||
}
|
||||
|
||||
// Find first character behind the closing parenthesis of the current group, or end of string
|
||||
|
|
Loading…
Reference in a new issue