Skip to content

Commit 837a697

Browse files
author
Fabrice Bellard
committed
regexp: allow [\-] in unicode mode (#373)
1 parent 1be68b3 commit 837a697

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libregexp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,10 @@ static int get_class_atom(REParseState *s, CharRange *cr,
686686
c = '\\';
687687
}
688688
break;
689+
case '-':
690+
if (!inclass && s->is_unicode)
691+
goto invalid_escape;
692+
break;
689693
#ifdef CONFIG_ALL_UNICODE
690694
case 'p':
691695
case 'P':

0 commit comments

Comments
 (0)