changeset 9405:b7f3059c308a

* cmds.c (Fforward_line): Call scan_buffer with new args. (Fend_of_line): Replace call to Fforward_line and search loop with call to find_before_next_newline.
author Jim Blandy <jimb@redhat.com>
date Sat, 08 Oct 1994 22:13:15 +0000
parents 698990d4feca
children a549857b7a13
files src/cmds.c
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/cmds.c	Sat Oct 08 22:12:45 1994 +0000
+++ b/src/cmds.c	Sat Oct 08 22:13:15 1994 +0000
@@ -106,7 +106,7 @@
     }
 
   negp = count <= 0;
-  pos = scan_buffer ('\n', pos2, count - negp, &shortage, 1);
+  pos = scan_buffer ('\n', pos2, 0, count - negp, &shortage, 1);
   if (shortage > 0
       && (negp
 	  || (ZV > BEGV
@@ -150,13 +150,7 @@
   else
     CHECK_NUMBER (n, 0);
 
-  if (XINT (n) != 1)
-    Fforward_line (make_number (XINT (n) - 1));
-
-  pos = point;
-  stop = ZV;
-  while (pos < stop && FETCH_CHAR (pos) != '\n') pos++;
-  SET_PT (pos);
+  SET_PT (find_before_next_newline (PT, 0, XINT (n) - (XINT (n) <= 0)));
 
   return Qnil;
 }