Skip to content

Commit 89f513f

Browse files
author
Reinhard Urban
committed
fix ranges with ending -
Fixes GH kokke#79 and the exreg failures with [1-5-]+[-1-2]-[-]
1 parent 148e229 commit 89f513f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

re.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ static int matchcharclass(char c, const char* str)
373373
{
374374
if (c == '-')
375375
{
376-
return ((str[-1] == '\0') || (str[1] == '\0'));
376+
if ((str[-1] == '\0') || (str[1] == '\0'))
377+
return 1;
378+
// else continue
377379
}
378380
else
379381
{

0 commit comments

Comments
 (0)