changeset 3087:ea0cb469490e

(Fforward_comment): Fix last change.
author Richard M. Stallman <rms@gnu.org>
date Tue, 25 May 1993 18:49:54 +0000
parents e414a29f8dc8
children 0f6e6e56b403
files src/syntax.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/syntax.c	Tue May 25 18:45:25 1993 +0000
+++ b/src/syntax.c	Tue May 25 18:49:54 1993 +0000
@@ -577,14 +577,17 @@
   register int c;
   register enum syntaxcode code;
   int comstyle = 0;	    /* style of comment encountered */
+  int found;
 
   immediate_quit = 1;
   QUIT;
 
   from = PT;
+  found = from;
 
   while (count > 0)
     {
+      found = from;
       stop = ZV;
       while (from < stop)
 	{
@@ -612,7 +615,7 @@
 		  if (from == stop)
 		    {
 		      immediate_quit = 0;
-		      SET_PT (from);
+		      SET_PT (found);
 		      return Qnil;
 		    }
 		  c = FETCH_CHAR (from);
@@ -637,7 +640,7 @@
 	  else if (code != Swhitespace)
 	    {
 	      immediate_quit = 0;
-	      SET_PT (from);
+	      SET_PT (found);
 	      return Qnil;
 	    }
 	}
@@ -648,6 +651,8 @@
 
   while (count < 0)
     {
+      found = from;
+
       stop = BEGV;
       while (from > stop)
 	{
@@ -687,7 +692,7 @@
 		      if (from == stop)
 			{
 			  immediate_quit = 0;
-			  SET_PT (from);
+			  SET_PT (found);
 			  return Qnil;
 			}
 		      from--;
@@ -811,7 +816,7 @@
 	  else if (code != Swhitespace || quoted)
 	    {
 	      immediate_quit = 0;
-	      SET_PT (from);
+	      SET_PT (found);
 	      return Qnil;
 	    }
 	}