changeset 5707:8cfacae7bbe5

Avoid goto-ing inside the scope of a local variable. Needed when CC=g++.
author Bruno Haible <bruno@clisp.org>
date Tue, 15 Mar 2005 12:01:41 +0000
parents b4e995417c9b
children fe9ee0b5e8c9
files lib/ChangeLog lib/regex.c
diffstat 2 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -3,6 +3,9 @@
 	* regex.c (byte_re_match_2_internal): Rename local variable 'not' to
 	'negate'.
 
+	* regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
+	variable.
+
 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -6010,19 +6010,22 @@
 	     longest match, try backtracking.  */
 	  if (d != end_match_2)
 	    {
-	      /* 1 if this match ends in the same string (string1 or string2)
-		 as the best previous match.  */
-	      boolean same_str_p = (FIRST_STRING_P (match_end)
-				    == MATCHING_IN_FIRST_STRING);
 	      /* 1 if this match is the best seen so far.  */
 	      boolean best_match_p;
 
-	      /* AIX compiler got confused when this was combined
-		 with the previous declaration.  */
-	      if (same_str_p)
-		best_match_p = d > match_end;
-	      else
-		best_match_p = !MATCHING_IN_FIRST_STRING;
+	      {
+		/* 1 if this match ends in the same string (string1 or string2)
+		   as the best previous match.  */
+		boolean same_str_p = (FIRST_STRING_P (match_end)
+				      == MATCHING_IN_FIRST_STRING);
+
+		/* AIX compiler got confused when this was combined
+		   with the previous declaration.  */
+		if (same_str_p)
+		  best_match_p = d > match_end;
+		else
+		  best_match_p = !MATCHING_IN_FIRST_STRING;
+	      }
 
 	      DEBUG_PRINT1 ("backtracking.\n");