make '' default to file beginning if no large movements yet
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 7 Dec 1988 10:25:09 +0000 (02:25 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 7 Dec 1988 10:25:09 +0000 (02:25 -0800)
SCCS-vsn: usr.bin/more/prim.c 5.6
SCCS-vsn: usr.bin/more/more.1 5.10

usr/src/usr.bin/more/more.1
usr/src/usr.bin/more/prim.c

index 039f537..83db9c1 100644 (file)
@@ -16,7 +16,7 @@
 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
-.\"    @(#)more.1      5.9 (Berkeley) %G%
+.\"    @(#)more.1      5.10 (Berkeley) %G%
 .\"
 .TH MORE 1
 .SH NAME
 .\"
 .TH MORE 1
 .SH NAME
@@ -155,7 +155,8 @@ marks the current position with that letter.
 Followed by any lowercase letter, returns to the position which
 was previously marked with that letter.
 Followed by another single quote, returns to the postion at
 Followed by any lowercase letter, returns to the position which
 was previously marked with that letter.
 Followed by another single quote, returns to the postion at
-which the last "large" movement command was executed.
+which the last "large" movement command was executed, or the
+beginning of the file if no such movements have occurred.
 All marks are lost when a new file is examined.
 .PP
 .IP /pattern
 All marks are lost when a new file is examined.
 .PP
 .IP /pattern
index 4049f8d..8358666 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)prim.c     5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)prim.c     5.6 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -531,17 +531,21 @@ gomark(c)
 {
        off_t pos;
 
 {
        off_t pos;
 
-       if (c == '\'')
+       if (c == '\'') {
                pos = marks[LASTMARK];
                pos = marks[LASTMARK];
-       else if (badmark(c))
-               return;
-       else 
+               if (pos == NULL_POSITION)
+                       pos = 0;
+       }
+       else {
+               if (badmark(c))
+                       return;
                pos = marks[c-'a'];
                pos = marks[c-'a'];
-
-       if (pos == NULL_POSITION)
-               error("mark not set");
-       else
-               jump_loc(pos);
+               if (pos == NULL_POSITION) {
+                       error("mark not set");
+                       return;
+               }
+       }
+       jump_loc(pos);
 }
 
 /*
 }
 
 /*