All of lore.kernel.org
 help / color / mirror / Atom feed
* Additions to earlier more POSIX compliance patch.
@ 2021-06-24 21:26 Ian Jones
  0 siblings, 0 replies; only message in thread
From: Ian Jones @ 2021-06-24 21:26 UTC (permalink / raw)
  To: util-linux

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

Hi,

Apologies, I forgot to update the manpage. I have also modified the
prompt to display '(END)' at EOF.

I hope you find these patches acceptable.

Best regards,

Ian

[-- Attachment #2: 0003-Addition-of-e-flag-to-for-POSIX-compliance.patch --]
[-- Type: text/x-diff, Size: 780 bytes --]

From fc87c44a7bce26fdf4e5048f37d37fc3e059c29b Mon Sep 17 00:00:00 2001
From: Ian Jones <ian@contractcoder.biz>
Date: Thu, 24 Jun 2021 14:14:21 +0100
Subject: [PATCH 3/6] Addition of -e flag to for POSIX compliance.

---
 text-utils/more.1.adoc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/text-utils/more.1.adoc b/text-utils/more.1.adoc
index 43124cac1..9cb463453 100644
--- a/text-utils/more.1.adoc
+++ b/text-utils/more.1.adoc
@@ -65,6 +65,9 @@ Prompt with "[Press space to continue, 'q' to quit.]", and display "[Press 'h' f
 *-l*, *--logical*::
 Do not pause after any line containing a *^L* (form feed).
 
+*-e*, *--exit-on-eof*::
+Exit on EOF.
+
 *-f*, *--no-pause*::
 Count logical lines, rather than screen lines (i.e., long lines are not folded).
 
-- 
2.20.1


[-- Attachment #3: 0006-Display-END-at-EOF.patch --]
[-- Type: text/x-diff, Size: 1121 bytes --]

From 2d9001cc3f4eac9f74599b687ca6ea552332ddfc Mon Sep 17 00:00:00 2001
From: Ian Jones <ian@contractcoder.biz>
Date: Thu, 24 Jun 2021 22:02:23 +0100
Subject: [PATCH 6/6] Display '(END)' at EOF.

---
 text-utils/more.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/text-utils/more.c b/text-utils/more.c
index f4da7724e..d1fab940c 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -732,9 +732,13 @@ static void output_prompt(struct more_control *ctl, char *filename)
 		if (filename != NULL) {
 			ctl->prompt_len += printf(_("(Next file: %s)"), filename);
 		} else if (!ctl->no_tty_in && 0 < ctl->file_size) {
-			ctl->prompt_len +=
-			    printf("(%d%%)",
-				   (int)((ctl->file_position * 100) / ctl->file_size));
+            int position = ((ctl->file_position * 100) / ctl->file_size);
+            if (position == 100) {
+		        erase_to_col(ctl, 0);
+                ctl->prompt_len += printf(_("(END)"));
+            } else {
+			    ctl->prompt_len += printf("(%d%%)", position);
+            }
 		}
 		if (ctl->suppress_bell) {
 			ctl->prompt_len +=
-- 
2.20.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-24 21:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-24 21:26 Additions to earlier more POSIX compliance patch Ian Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.