diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-09-21 22:10:55 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-09-21 22:10:55 +0200 |
commit | 15943c886d6e1929b90db9bc6077c849cbaa187e (patch) | |
tree | 28944adbdff776ea87df743ac99326e189e23770 /miscutils | |
parent | fbdc167f27193fd7e00f85537af122eba674fe95 (diff) | |
download | busybox-w32-15943c886d6e1929b90db9bc6077c849cbaa187e.tar.gz busybox-w32-15943c886d6e1929b90db9bc6077c849cbaa187e.tar.bz2 busybox-w32-15943c886d6e1929b90db9bc6077c849cbaa187e.zip |
less: disable "suppress empty wraparound" optimization
It is buggy wrt another use case...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/less.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index d84df469c..719af5a0d 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
@@ -491,6 +491,11 @@ static void read_lines(void) | |||
491 | *p++ = c; | 491 | *p++ = c; |
492 | *p = '\0'; | 492 | *p = '\0'; |
493 | } /* end of "read chars until we have a line" loop */ | 493 | } /* end of "read chars until we have a line" loop */ |
494 | #if 0 | ||
495 | //BUG: also triggers on this: | ||
496 | // { printf "\nfoo\n"; sleep 1; printf "\nbar\n"; } | less | ||
497 | // (resulting in lost empty line between "foo" and "bar" lines) | ||
498 | // the "terminated" logic needs fixing (or explaining) | ||
494 | /* Corner case: linewrap with only "" wrapping to next line */ | 499 | /* Corner case: linewrap with only "" wrapping to next line */ |
495 | /* Looks ugly on screen, so we do not store this empty line */ | 500 | /* Looks ugly on screen, so we do not store this empty line */ |
496 | if (!last_terminated && !current_line[0]) { | 501 | if (!last_terminated && !current_line[0]) { |
@@ -498,6 +503,7 @@ static void read_lines(void) | |||
498 | max_lineno++; | 503 | max_lineno++; |
499 | continue; | 504 | continue; |
500 | } | 505 | } |
506 | #endif | ||
501 | reached_eof: | 507 | reached_eof: |
502 | last_terminated = terminated; | 508 | last_terminated = terminated; |
503 | flines = xrealloc_vector(flines, 8, max_fline); | 509 | flines = xrealloc_vector(flines, 8, max_fline); |