aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-07 22:57:47 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-07 22:57:47 +0000
commitc33ebc9741a475962e29fafe60bb0ba4450854b6 (patch)
tree140a377a23216aad85346d940e66f203dcd80b30
parent04b0354d8e0b09ed2af80f590e2203137114819b (diff)
downloadbusybox-c33ebc9741a475962e29fafe60bb0ba4450854b6.tar.gz
A patch from Vladimir to use last_char_is(), and a patch from
Larry to fix a silly bug when BB_FEATURE_VI_OPTIMIZE_CURSOR is not defined.
-rw-r--r--editors/vi.c11
-rw-r--r--vi.c11
2 files changed, 14 insertions, 8 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 54f1d265c..5a68ba9f1 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -19,7 +19,7 @@
*/
char *vi_Version =
- "$Id: vi.c,v 1.6 2001/05/07 17:37:43 andersen Exp $";
+ "$Id: vi.c,v 1.7 2001/05/07 22:57:47 andersen Exp $";
/*
* To compile for standalone use:
@@ -1760,9 +1760,10 @@ static void colon(Byte * buf)
while (isblnk(*buf))
buf++;
strcpy((char *) args, (char *) buf);
- if (last_char_is((char *)cmd, '!')) {
+ buf1 = last_char_is((char *)cmd, '!');
+ if (buf1) {
useforce = TRUE;
- cmd[strlen((char *) cmd) - 1] = '\0'; // get rid of !
+ *buf1 = '\0'; // get rid of !
}
if (b >= 0) {
// if there is only one addr, then the addr
@@ -3919,9 +3920,11 @@ static void refresh(int full_screen)
}
}
- place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE);
#ifdef BB_FEATURE_VI_OPTIMIZE_CURSOR
+ place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE);
last_row = crow;
+#else
+ place_cursor(crow, ccol, FALSE);
#endif /* BB_FEATURE_VI_OPTIMIZE_CURSOR */
if (offset != old_offset)
diff --git a/vi.c b/vi.c
index 54f1d265c..5a68ba9f1 100644
--- a/vi.c
+++ b/vi.c
@@ -19,7 +19,7 @@
*/
char *vi_Version =
- "$Id: vi.c,v 1.6 2001/05/07 17:37:43 andersen Exp $";
+ "$Id: vi.c,v 1.7 2001/05/07 22:57:47 andersen Exp $";
/*
* To compile for standalone use:
@@ -1760,9 +1760,10 @@ static void colon(Byte * buf)
while (isblnk(*buf))
buf++;
strcpy((char *) args, (char *) buf);
- if (last_char_is((char *)cmd, '!')) {
+ buf1 = last_char_is((char *)cmd, '!');
+ if (buf1) {
useforce = TRUE;
- cmd[strlen((char *) cmd) - 1] = '\0'; // get rid of !
+ *buf1 = '\0'; // get rid of !
}
if (b >= 0) {
// if there is only one addr, then the addr
@@ -3919,9 +3920,11 @@ static void refresh(int full_screen)
}
}
- place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE);
#ifdef BB_FEATURE_VI_OPTIMIZE_CURSOR
+ place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE);
last_row = crow;
+#else
+ place_cursor(crow, ccol, FALSE);
#endif /* BB_FEATURE_VI_OPTIMIZE_CURSOR */
if (offset != old_offset)