aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-12-31 19:36:01 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-12-31 19:36:01 +0000
commit50ddabc8592a528c84f236467f4febe9795e2d6b (patch)
tree3d39b47cae1ff8aed5dbd78dc9f0458a33b05fe6 /miscutils
parent95b307103a60b7d023929c29952e1e6798564bef (diff)
downloadbusybox-50ddabc8592a528c84f236467f4febe9795e2d6b.tar.gz
less: fix <tab><backspace> buglet
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/less.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/miscutils/less.c b/miscutils/less.c
index ae936c2fb..20da02208 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -212,13 +212,13 @@ static void read_lines(void)
}
}
c = readbuf[readpos];
- /* backspace? [need this for manpage display] */
- if (c == '\x8' && linepos) {
+ /* backspace? [needed for manpages] */
+ /* <tab><bs> is (a) insane and */
+ /* (b) harder to do correctly, so we refuse to do it */
+ if (c == '\x8' && linepos && p[-1] != '\t') {
readpos++; /* eat it */
- /* We do not consider the case of <tab><bs> */
- /* Anyone who has that is pure evil :) */
linepos--;
- *p-- = '\0';
+ *--p = '\0';
continue;
}
if (c == '\t')