From: Ian Jones <ian@contractcoder.biz>
To: util-linux@vger.kernel.org
Subject: Additions to earlier more POSIX compliance patch.
Date: Thu, 24 Jun 2021 22:26:32 +0100 [thread overview]
Message-ID: <20210624212632.GC2541@contractcoder.biz> (raw)
[-- 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
reply other threads:[~2021-06-24 21:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210624212632.GC2541@contractcoder.biz \
--to=ian@contractcoder.biz \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).