summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-09-21 22:10:55 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2014-09-21 22:10:55 +0200
commit15943c886d6e1929b90db9bc6077c849cbaa187e (patch)
tree28944adbdff776ea87df743ac99326e189e23770
parentfbdc167f27193fd7e00f85537af122eba674fe95 (diff)
downloadbusybox-15943c886d6e1929b90db9bc6077c849cbaa187e.tar.gz
less: disable "suppress empty wraparound" optimization
It is buggy wrt another use case... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--miscutils/less.c6
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)
*p++ = c;
*p = '\0';
} /* end of "read chars until we have a line" loop */
+#if 0
+//BUG: also triggers on this:
+// { printf "\nfoo\n"; sleep 1; printf "\nbar\n"; } | less
+// (resulting in lost empty line between "foo" and "bar" lines)
+// the "terminated" logic needs fixing (or explaining)
/* Corner case: linewrap with only "" wrapping to next line */
/* Looks ugly on screen, so we do not store this empty line */
if (!last_terminated && !current_line[0]) {
@@ -498,6 +503,7 @@ static void read_lines(void)
max_lineno++;
continue;
}
+#endif
reached_eof:
last_terminated = terminated;
flines = xrealloc_vector(flines, 8, max_fline);