[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox-cvs
Subject: svn commit: trunk/busybox/miscutils
From: vda () busybox ! net (vda at busybox ! net)
Date: 2006-12-31 19:23:32
Message-ID: 20061231192332.AFE52485AB () busybox ! net
[Download RAW message or body]
Author: vda
Date: 2006-12-31 11:23:31 -0800 (Sun, 31 Dec 2006)
New Revision: 17120
Log:
less: interpret backspace.
less is officially declared PAGER-capable! ;)
(this includes viewing of manpages)
Modified:
trunk/busybox/miscutils/less.c
Changeset:
Modified: trunk/busybox/miscutils/less.c
===================================================================
--- trunk/busybox/miscutils/less.c 2006-12-31 19:07:23 UTC (rev 17119)
+++ trunk/busybox/miscutils/less.c 2006-12-31 19:23:31 UTC (rev 17120)
@@ -212,11 +212,21 @@
}
}
c = readbuf[readpos];
+ /* backspace? [need this for manpage display] */
+ if (c == '\x8' && linepos) {
+ readpos++; /* eat it */
+ /* We do not consider the case of <tab><bs> */
+ /* Anyone who has that is pure evil :) */
+ linepos--;
+ *p-- = '\0';
+ continue;
+ }
if (c == '\t')
linepos += (linepos^7) & 7;
linepos++;
if (linepos >= w)
break;
+ /* ok, we will eat this char */
readpos++;
if (c == '\n') { terminated = 1; break; }
/* NUL is substituted by '\n'! */
@@ -1175,6 +1185,9 @@
{
int keypress;
+ /* TODO: -x: do not interpret backspace, -xx: tab also */
+ /* -xxx: newline also */
+ /* -w N: assume width N (-xxx -w 32: hex viewer of sorts) */
getopt32(argc, argv, "EMmN~");
argc -= optind;
argv += optind;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic