From 6d713a99954cf8f800ebf06894840cbd5c6e89ba Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Wed, 23 Nov 1988 01:41:29 -0800 Subject: [PATCH] =/^G show total bytes now; document may not always work SCCS-vsn: usr.bin/more/command.c 5.11 SCCS-vsn: usr.bin/more/more.1 5.6 --- usr/src/usr.bin/more/command.c | 10 +++++----- usr/src/usr.bin/more/more.1 | 12 ++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/usr/src/usr.bin/more/command.c b/usr/src/usr.bin/more/command.c index 6454dbaf4d..48a0e42903 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.10 (Berkeley) %G%"; +static char sccsid[] = "@(#)command.c 5.11 (Berkeley) %G%"; #endif /* not lint */ /* @@ -206,15 +206,15 @@ prompt() putstr(pbuf); } if (linenums) { - (void)sprintf(pbuf, " line %d", currline(TOP)); + (void)sprintf(pbuf, " line %d", currline(BOTTOM)); putstr(pbuf); } - if ((pos = position(TOP)) != NULL_POSITION) { + if ((pos = position(BOTTOM)) != NULL_POSITION) { (void)sprintf(pbuf, " byte %ld", pos); putstr(pbuf); if (!ispipe && (len = ch_length())) { - (void)sprintf(pbuf, " pct %ld%%", - ((100 * pos) / len)); + (void)sprintf(pbuf, "/%ld pct %ld%%", + len, ((100 * pos) / len)); putstr(pbuf); } } diff --git a/usr/src/usr.bin/more/more.1 b/usr/src/usr.bin/more/more.1 index cdb5b2c86c..d143c90a7f 100644 --- a/usr/src/usr.bin/more/more.1 +++ b/usr/src/usr.bin/more/more.1 @@ -16,7 +16,7 @@ .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" -.\" @(#)more.1 5.5 (Berkeley) %G% +.\" @(#)more.1 5.6 (Berkeley) %G% .\" .TH MORE 1 .SH NAME @@ -211,9 +211,13 @@ or defaults to .PP .IP "= or ^G" These options print out the number of the file currently being displayed -relative to the total number of files there are to display, the line -number, the byte number, and what percentage of the file has been displayed -if possible. All of these are for the bottom line on the screen. +relative to the total number of files there are to display, the current +line number, the current byte number and the total bytes to display, and +what percentage of the file has been displayed. If +.I more +is reading from stdin, or the file is shorter than a single screen, some +of these items may not be available. Note, all of these items reference +the first byte of the last line displayed on the screen. .PP .IP "q or :q or ZZ" Exits -- 2.20.1