summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-07-11 22:51:15 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2009-07-11 22:51:15 (GMT)
commit1302892a14e8660b1f577f2cde710103c366d413 (patch)
tree7be79d94302f7c84269249c697f6b15eaf37dc28
parentfda8f57360aaf24dba3784aae4818f5a351f5c7d (diff)
downloadbusybox-1302892a14e8660b1f577f2cde710103c366d413.tar.gz
busybox-1302892a14e8660b1f577f2cde710103c366d413.tar.bz2
vi: small code shrink
function old new delta vi_word_motion 185 165 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/lineedit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index ab32972..6e836d8 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1296,8 +1296,10 @@ vi_word_motion(int eat)
if (BB_isalnum(command[cursor]) || command[cursor] == '_') {
while (cursor < command_len
- && (BB_isalnum(command[cursor+1]) || command[cursor+1] == '_'))
+ && (BB_isalnum(command[cursor+1]) || command[cursor+1] == '_')
+ ) {
input_forward();
+ }
} else if (BB_ispunct(command[cursor])) {
while (cursor < command_len && BB_ispunct(command[cursor+1]))
input_forward();
@@ -1306,9 +1308,10 @@ vi_word_motion(int eat)
if (cursor < command_len)
input_forward();
- if (eat && cursor < command_len && BB_isspace(command[cursor]))
+ if (eat) {
while (cursor < command_len && BB_isspace(command[cursor]))
input_forward();
+ }
}
static void
@@ -1592,7 +1595,7 @@ static int lineedit_read_key(char *read_key_buffer)
/* leave out the "vi-mode"-only case labels if vi editing isn't
* configured. */
-#define vi_case(caselabel) IF_FEATURE_EDITING(case caselabel)
+#define vi_case(caselabel) IF_FEATURE_EDITING_VI(case caselabel)
/* convert uppercase ascii to equivalent control char, for readability */
#undef CTRL