summaryrefslogtreecommitdiff
path: root/editors/vi.c
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 /editors/vi.c
parent04b0354d8e0b09ed2af80f590e2203137114819b (diff)
downloadbusybox-w32-c33ebc9741a475962e29fafe60bb0ba4450854b6.tar.gz
busybox-w32-c33ebc9741a475962e29fafe60bb0ba4450854b6.tar.bz2
busybox-w32-c33ebc9741a475962e29fafe60bb0ba4450854b6.zip
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.
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c11
1 files changed, 7 insertions, 4 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 @@
19 */ 19 */
20 20
21char *vi_Version = 21char *vi_Version =
22 "$Id: vi.c,v 1.6 2001/05/07 17:37:43 andersen Exp $"; 22 "$Id: vi.c,v 1.7 2001/05/07 22:57:47 andersen Exp $";
23 23
24/* 24/*
25 * To compile for standalone use: 25 * To compile for standalone use:
@@ -1760,9 +1760,10 @@ static void colon(Byte * buf)
1760 while (isblnk(*buf)) 1760 while (isblnk(*buf))
1761 buf++; 1761 buf++;
1762 strcpy((char *) args, (char *) buf); 1762 strcpy((char *) args, (char *) buf);
1763 if (last_char_is((char *)cmd, '!')) { 1763 buf1 = last_char_is((char *)cmd, '!');
1764 if (buf1) {
1764 useforce = TRUE; 1765 useforce = TRUE;
1765 cmd[strlen((char *) cmd) - 1] = '\0'; // get rid of ! 1766 *buf1 = '\0'; // get rid of !
1766 } 1767 }
1767 if (b >= 0) { 1768 if (b >= 0) {
1768 // if there is only one addr, then the addr 1769 // if there is only one addr, then the addr
@@ -3919,9 +3920,11 @@ static void refresh(int full_screen)
3919 } 3920 }
3920 } 3921 }
3921 3922
3922 place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE);
3923#ifdef BB_FEATURE_VI_OPTIMIZE_CURSOR 3923#ifdef BB_FEATURE_VI_OPTIMIZE_CURSOR
3924 place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE);
3924 last_row = crow; 3925 last_row = crow;
3926#else
3927 place_cursor(crow, ccol, FALSE);
3925#endif /* BB_FEATURE_VI_OPTIMIZE_CURSOR */ 3928#endif /* BB_FEATURE_VI_OPTIMIZE_CURSOR */
3926 3929
3927 if (offset != old_offset) 3930 if (offset != old_offset)