From: Fabrice Bellard Date: Thu, 13 Mar 2025 18:00:25 +0000 (+0100) Subject: regexp: allow [\-] in unicode mode (#373) X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/postgres_fdw.c?a=commitdiff_plain;h=837a69758874339a75560d99cea665f1966799c8;p=quickjs.git regexp: allow [\-] in unicode mode (#373) --- 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':