changeset 6197:4b3066daba2f

* regex_internal.c (re_string_context_at): Fix bug where the code assumed that Idx is signed. * config/srclist.txt: Add glibc bug 1287.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 01 Sep 2005 22:10:59 +0000
parents 49579c047f1d
children 4270667abdee
files config/ChangeLog config/srclist.txt lib/ChangeLog lib/regex_internal.c
diffstat 4 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,6 +1,6 @@
 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
 
-	* srclist.txt: Add glibc bug 1285, 1286.
+	* srclist.txt: Add glibc bugs 1285-1287.
 
 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
 
--- a/config/srclist.txt
+++ b/config/srclist.txt
@@ -1,4 +1,4 @@
-# $Id: srclist.txt,v 1.97 2005-09-01 21:01:27 eggert Exp $
+# $Id: srclist.txt,v 1.98 2005-09-01 22:10:59 eggert Exp $
 # Files for which we are not the source.  See ./srclistvars.sh for the
 # variable definitions.
 
@@ -136,6 +136,7 @@
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1284
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1285
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1286
+# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1287
 #$LIBCSRC/posix/regex_internal.c		lib gpl
 #
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1054
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -2,6 +2,8 @@
 
 	* regex_internal.c (build_wcs_upper_buffer): Fix portability
 	bugs in int versus size_t comparisons.
+	(re_string_context_at): Fix bug where the code assumed that
+	Idx is signed.
 
 	Use bool where appropriate.
 	* regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
--- a/lib/regex_internal.c
+++ b/lib/regex_internal.c
@@ -843,10 +843,10 @@
 	{
 #ifdef DEBUG
 	  /* It must not happen.  */
-	  assert (wc_idx >= 0);
+	  assert (REG_VALID_INDEX (wc_idx));
 #endif
 	  --wc_idx;
-	  if (wc_idx < 0)
+	  if (! REG_VALID_INDEX (wc_idx))
 	    return input->tip_context;
 	}
       wc = input->wcs[wc_idx];