Blob Blame History Raw
Set re_nsub in regcomp() properly

Port from upstream commit:

r1024 | ph10 | 2012-08-29 13:08:24 +0200 (St, 29 srp 2012) | 2 lines
Fix re_nsub bug in the POSIX wrapper.

https://bugzilla.redhat.com/show_bug.cgi?id=853990
http://bugs.exim.org/show_bug.cgi?id=1287

Index: pcreposix.c
===================================================================
--- pcreposix.c	(revision 1023)
+++ pcreposix.c	(revision 1024)
@@ -259,6 +259,7 @@
 int erroffset;
 int errorcode;
 int options = 0;
+int re_nsub = 0;
 
 if ((cflags & REG_ICASE) != 0)    options |= PCRE_CASELESS;
 if ((cflags & REG_NEWLINE) != 0)  options |= PCRE_MULTILINE;
@@ -282,7 +283,8 @@
   }
 
 (void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT,
-  &(preg->re_nsub));
+  &re_nsub);
+preg->re_nsub = (size_t)re_nsub; 
 return 0;
 }