From 18934137ddfd765025e73b2eb1a1bb83ee5fc03b Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 18 Jul 2022 13:10:53 +0000 Subject: [PATCH] Fix a problem in the REGEXP extension for the {M,N} construct where M is zero. See [forum:/forumpost/8694e55a2c29963c|forum post 8694e55a2c29963c] for more information. FossilOrigin-Name: af15bb75306a4b94593b8431a34768b3de3d6689293e85ca02db16bf3e9f39e2 --- ext/misc/regexp.c | 1 + manifest | 14 +++++++------- manifest.uuid | 2 +- test/regexp1.test | 11 +++++++++++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ext/misc/regexp.c b/ext/misc/regexp.c index 54c505233d..8a3e13115f 100644 --- a/ext/misc/regexp.c +++ b/ext/misc/regexp.c @@ -568,6 +568,7 @@ static const char *re_subcompile_string(ReCompiled *p){ if( m==0 ){ if( n==0 ) return "both m and n are zero in '{m,n}'"; re_insert(p, iPrev, RE_OP_FORK, sz+1); + iPrev++; n--; }else{ for(j=1; j