From 0c8732c8583c7e31476c0ec1c0ac92cc7e5f8bc0 Mon Sep 17 00:00:00 2001 From: nigel Date: Sat, 24 Feb 2007 21:38:49 +0000 Subject: Load pcre-2.02 into code/trunk. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@27 2f5784b3-3f2a-0410-8824-cb99058d5e15 --- pcre.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pcre.c') diff --git a/pcre.c b/pcre.c index bc09a47..320b8e2 100644 --- a/pcre.c +++ b/pcre.c @@ -9,7 +9,7 @@ the file Tech.Notes for some information on the internals. Written by: Philip Hazel - Copyright (c) 1998 University of Cambridge + Copyright (c) 1997-1999 University of Cambridge ----------------------------------------------------------------------------- Permission is granted to anyone to use this software for any purpose on any @@ -4033,6 +4033,17 @@ in the pattern. */ resetcount = 2 + re->top_bracket * 2; if (resetcount > offsetcount) resetcount = ocount; +/* Reset the working variable associated with each extraction. These should +never be used unless previously set, but they get saved and restored, and so we +initialize them to avoid reading uninitialized locations. */ + +if (match_block.offset_vector != NULL) + { + register int *iptr = match_block.offset_vector + ocount; + register int *iend = iptr - resetcount/2 + 1; + while (--iptr >= iend) *iptr = -1; + } + /* Set up the first character to match, if available. The first_char value is never set for an anchored regular expression, but the anchoring may be forced at run time, so we have to test for anchoring. The first char may be unset for -- cgit v1.2.1