[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] less: respect -E (quit at EOF)
From:       Aaro Koskinen <aaro.koskinen () iki ! fi>
Date:       2013-09-13 21:13:52
Message-ID: 1379106832-17338-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>
---
 miscutils/less.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/miscutils/less.c b/miscutils/less.c
index 60105f4..9b0478a 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) &&
+	    (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