From 32aea2087a699bb4bd9c34347b6ef8d164ee0d0b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 16 Jun 2011 16:53:11 -0400 Subject: duplicate re_nsub in LSB/glibc ABI compatible location --- include/regex.h | 3 ++- src/regex/regcomp.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/regex.h b/include/regex.h index 3673bfa7..d57208a5 100644 --- a/include/regex.h +++ b/include/regex.h @@ -13,7 +13,8 @@ typedef long regoff_t; typedef struct { size_t re_nsub; - void *__opaque; + void *__opaque, *__padding[4]; + size_t __nsub2; } regex_t; typedef struct { 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 -- cgit v1.2.1