print out percentage by default, rather than line number
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 8 Dec 1988 12:06:28 +0000 (04:06 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 8 Dec 1988 12:06:28 +0000 (04:06 -0800)
SCCS-vsn: usr.bin/more/command.c 5.16

usr/src/usr.bin/more/command.c

index 012b105..a654489 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)command.c  5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)command.c  5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -195,8 +195,10 @@ prompt()
                        }
                        else
                                putstr(": END");
                        }
                        else
                                putstr(": END");
-               else if (linenums) {
-                       (void)sprintf(pbuf, ": %d", currline(TOP));
+               else if (!ispipe &&
+                   (pos = position(BOTTOM)) != NULL_POSITION &&
+                   (len = ch_length())) {
+                       (void)sprintf(pbuf, " (%ld%%)", ((100 * pos) / len));
                        putstr(pbuf);
                }
                so_exit();
                        putstr(pbuf);
                }
                so_exit();