diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-08-02 05:26:41 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-08-02 05:26:41 +0000 |
commit | 4a09c7d5e4ea07753e9c0991d3dc7e358b4a3958 (patch) | |
tree | 3223258892abf2d17b39793a1ddddc9e46aec8ee /vi.c | |
parent | 531677ca03f875747c898cca3b27fd53316ac3bc (diff) | |
download | busybox-w32-4a09c7d5e4ea07753e9c0991d3dc7e358b4a3958.tar.gz busybox-w32-4a09c7d5e4ea07753e9c0991d3dc7e358b4a3958.tar.bz2 busybox-w32-4a09c7d5e4ea07753e9c0991d3dc7e358b4a3958.zip |
Patch from Robert J. Osborne <rj@resourceinternational.com> that fixes
a bug in vi where the beginning of the text space was not checked
before dot is decremented for delete and escape sequences on an empty
file.
git-svn-id: svn://busybox.net/trunk/busybox@3184 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r-- | vi.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | static const char vi_Version[] = | 21 | static const char vi_Version[] = |
22 | "$Id: vi.c,v 1.14 2001/07/31 15:01:12 kraai Exp $"; | 22 | "$Id: vi.c,v 1.15 2001/08/02 05:26:41 andersen Exp $"; |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * To compile for standalone use: | 25 | * To compile for standalone use: |
@@ -2640,12 +2640,12 @@ static Byte *char_insert(Byte * p, Byte c) // insert the char c at 'p' | |||
2640 | cmdcnt = 0; | 2640 | cmdcnt = 0; |
2641 | end_cmd_q(); // stop adding to q | 2641 | end_cmd_q(); // stop adding to q |
2642 | strcpy((char *) status_buffer, " "); // clear the status buffer | 2642 | strcpy((char *) status_buffer, " "); // clear the status buffer |
2643 | if (p[-1] != '\n') { | 2643 | if ((p[-1] != '\n') && (dot>text)) { |
2644 | p--; | 2644 | p--; |
2645 | } | 2645 | } |
2646 | } else if (c == erase_char) { // Is this a BS | 2646 | } else if (c == erase_char) { // Is this a BS |
2647 | // 123456789 | 2647 | // 123456789 |
2648 | if (p[-1] != '\n') { | 2648 | if ((p[-1] != '\n') && (dot>text)) { |
2649 | p--; | 2649 | p--; |
2650 | p = text_hole_delete(p, p); // shrink buffer 1 char | 2650 | p = text_hole_delete(p, p); // shrink buffer 1 char |
2651 | #ifdef BB_FEATURE_VI_DOT_CMD | 2651 | #ifdef BB_FEATURE_VI_DOT_CMD |