hi list,
this patch adds a check that
the address p is larger the current buffer adress text when accessing p-1
because at begining p==text is possible.
the first place have a dot>text (cursor pos) it could be that p=q is assumed
no idea if this is true

re,
 wh


--- editors/vi_org.c    2008-06-23 17:42:13.000000000 +0200
+++ ../vi.c     2008-06-23 17:38:10.000000000 +0200
@@ -1659,12 +1659,12 @@
                cmdcnt = 0;
                end_cmd_q();    // stop adding to q
                last_status_cksum = 0;  // force status update
-               if ((p > text) && (p[-1] != '\n') && (dot > text)) {
+               if ((p[-1] != '\n') && (dot > text)) {
                        p--;
                }
        } else if (c == erase_char || c == 8 || c == 127) { // Is this a BS
                //     123456789
-               if ((p > text) && (p[-1] != '\n') && (dot>text)) {
+               if ((p[-1] != '\n') && (dot>text)) {
                        p--;
                        p = text_hole_delete(p, p);     // shrink buffer 1 char
                }
@@ -3594,7 +3594,7 @@
        case 'O':                       // O- open a empty line above
                //    0i\n ESC -i
                p = begin_line(dot);
-               if ((p > text) && p[-1] == '\n') {
+               if (p[-1] == '\n') {
                        dot_prev();
        case 'o':                       // o- open a empty line below; Yes, I 
know it is in the midd
le of the "if (..."
                        dot_end();
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to