diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2025-03-13 19:00:25 +0100 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2025-03-13 19:00:25 +0100 |
commit | 837a69758874339a75560d99cea665f1966799c8 (patch) | |
tree | 314089499bb675debe4629e61808480dad5b42c1 /libregexp.c | |
parent | 1be68b3345953c94e8072d12ad116e14403b66a8 (diff) | |
download | quickjs-837a69758874339a75560d99cea665f1966799c8.tar.gz quickjs-837a69758874339a75560d99cea665f1966799c8.zip |
regexp: allow [\-] in unicode mode (#373)
Diffstat (limited to 'libregexp.c')
-rw-r--r-- | libregexp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libregexp.c b/libregexp.c index 9295fe7..8c47389 100644 --- a/libregexp.c +++ b/libregexp.c @@ -686,6 +686,10 @@ static int get_class_atom(REParseState *s, CharRange *cr, c = '\\'; } break; + case '-': + if (!inclass && s->is_unicode) + goto invalid_escape; + break; #ifdef CONFIG_ALL_UNICODE case 'p': case 'P': |