changeset 17072:b14c67f044a6

Fix previous change.
author Karl Heuer <kwzh@gnu.org>
date Sun, 23 Feb 1997 22:49:18 +0000
parents 70194012fb3a
children 5e66b1087c94
files src/search.c
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Sun Feb 23 09:20:52 1997 +0000
+++ b/src/search.c	Sun Feb 23 22:49:18 1997 +0000
@@ -848,10 +848,11 @@
 	  {
 	    while (pos > XINT (lim))
 	      {
+		int savepos = pos;
 		DEC_POS (pos);
 		if (!fastmap[(int) SYNTAX (FETCH_CHAR (pos))])
 		  {
-		    INC_POS (pos);
+		    pos = savepos;
 		    break;
 		  }
 	      }
@@ -889,6 +890,7 @@
 	  {
 	    while (pos > XINT (lim))
 	      {
+		int savepos = pos;
 		DEC_POS (pos);
 		if (fastmap[(c = FETCH_BYTE (pos))])
 		  {
@@ -903,14 +905,23 @@
 			  if (ch >= char_ranges[i] && ch <= char_ranges[i + 1])
 			    break;
 			if (!(negate ^ (i < n_char_ranges)))
-			  break;
+			  {
+			    pos = savepos;
+			    break;
+			  }
 		      }
 		    else
 		      if (!negate)
-			break;
+			{
+			  pos = savepos;
+			  break;
+			}
 		  }
 		else
-		  break;
+		  {
+		    pos = savepos;
+		    break;
+		  }
 	      }
 	  }
       }