From: Keith Bostic Date: Thu, 8 Dec 1988 12:06:28 +0000 (-0800) Subject: print out percentage by default, rather than line number X-Git-Tag: BSD-4_3_Net_1-Snapshot-Development~169 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/e80c9812e6e17ca58bb6d29fcda416dba89626f4 print out percentage by default, rather than line number SCCS-vsn: usr.bin/more/command.c 5.16 --- 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();