[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH v2] less: respect -E (quit at EOF)
From: Aaro Koskinen <aaro.koskinen () iki ! fi>
Date: 2013-10-16 19:31:50
Message-ID: 1381951910-27201-1-git-send-email-aaro.koskinen () iki ! fi
[Download RAW message or body]
less displays -E in help text, but it's not doing anything. Make it quit
less when the last lines of the file have been printed.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
Patch history:
v2: Also check that EOF was reached (eof_error <= 0).
v1: http://marc.info/?t=137910686900003&r=1&w=2
miscutils/less.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/miscutils/less.c b/miscutils/less.c
index 60105f4..52ffead 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -795,6 +795,9 @@ static void buffer_print(void)
print_found(buffer[i]);
else
print_ascii(buffer[i]);
+ if ((option_mask32 & FLAG_E) && eof_error <= 0 &&
+ (max_fline - cur_fline) <= max_displayed_line)
+ less_exit(EXIT_SUCCESS);
status_print();
}
--
1.8.4.rc3
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic