diff options
author | K.Kosako <kkosako0@gmail.com> | 2023-03-27 22:16:27 +0900 |
---|---|---|
committer | K.Kosako <kkosako0@gmail.com> | 2023-03-27 22:16:27 +0900 |
commit | e68b575eddb765e5353452b43b60882832792700 (patch) | |
tree | 19bcd1fdf71092c1b2ec2294644e199b1f3a08a9 | |
parent | ca89bbcc36bdab84a9db5e88b4db8e3b4a14445d (diff) | |
download | oniguruma-e68b575eddb765e5353452b43b60882832792700.zip oniguruma-e68b575eddb765e5353452b43b60882832792700.tar.gz oniguruma-e68b575eddb765e5353452b43b60882832792700.tar.bz2 |
fix #282: Dynamic library generated failed to support '(?-i)'
-rw-r--r-- | src/regparse.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/regparse.c b/src/regparse.c index 71d202d..c36460d 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -2,7 +2,7 @@ regparse.c - Oniguruma (regular expression library) **********************************************************************/ /*- - * Copyright (c) 2002-2022 K.Kosako + * Copyright (c) 2002-2023 K.Kosako * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -6218,8 +6218,20 @@ fetch_token(PToken* tok, UChar** src, UChar* end, ParseEnv* env) case '-': case '+': - goto lparen_qmark_num; + if (! PEND) { + PINC; + if (! PEND) { + c = PPEEK; + if (ONIGENC_IS_CODE_DIGIT(enc, c)) { + PUNFETCH; + goto lparen_qmark_num; + } + } + } + p = prev; + goto lparen_qmark_end2; break; + default: if (! ONIGENC_IS_CODE_DIGIT(enc, c)) goto lparen_qmark_end; |