diff options
author | Aaro Koskinen | 2014-09-23 22:58:18 +0200 |
---|---|---|
committer | Denys Vlasenko | 2014-09-23 22:58:18 +0200 |
commit | 307d26c0ebfb0d22a81070379675f6287f6e9d95 (patch) | |
tree | 0db5fef2a632b8d718c12d6a2dd258cc11e39256 /miscutils/less.c | |
parent | 865814a617cc2b197ef0ad12ee331a7a01d30e1a (diff) | |
download | busybox-307d26c0ebfb0d22a81070379675f6287f6e9d95.zip busybox-307d26c0ebfb0d22a81070379675f6287f6e9d95.tar.gz |
less: make -E work
function old new delta
buffer_print 71 104 +33
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/less.c')
-rw-r--r-- | miscutils/less.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index c5820d3..554e546 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -802,11 +802,18 @@ static void buffer_print(void) unsigned i; move_cursor(0, 0); - for (i = 0; i <= max_displayed_line; i++) + for (i = 0; i <= max_displayed_line; i++) { if (pattern_valid) 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(); } |