about summary refs log tree commit diff
path: root/src/regex
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex')
-rw-r--r--src/regex/regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c
index 3307942e..875f56fd 100644
--- a/src/regex/regcomp.c
+++ b/src/regex/regcomp.c
@@ -3115,7 +3115,7 @@ tre_compile(regex_t *preg, const tre_char_t *regex, size_t n, int cflags)
   errcode = tre_parse(&parse_ctx);
   if (errcode != REG_OK)
     ERROR_EXIT(errcode);
-  preg->re_nsub = parse_ctx.submatch_id - 1;
+  preg->re_nsub = preg->__nsub2 = parse_ctx.submatch_id - 1;
   tree = parse_ctx.result;
 
 #ifdef TRE_DEBUG