From e80c9812e6e17ca58bb6d29fcda416dba89626f4 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Thu, 8 Dec 1988 04:06:28 -0800 Subject: [PATCH] print out percentage by default, rather than line number SCCS-vsn: usr.bin/more/command.c 5.16 --- usr/src/usr.bin/more/command.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr/src/usr.bin/more/command.c b/usr/src/usr.bin/more/command.c index 012b1054d1..a654489506 100644 --- a/usr/src/usr.bin/more/command.c +++ b/usr/src/usr.bin/more/command.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)command.c 5.15 (Berkeley) %G%"; +static char sccsid[] = "@(#)command.c 5.16 (Berkeley) %G%"; #endif /* not lint */ #include @@ -195,8 +195,10 @@ prompt() } 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(); -- 2.20.1