]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.027 v7.4.027
authorBram Moolenaar <Bram@vim.org>
Sun, 8 Sep 2013 18:00:48 +0000 (20:00 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 8 Sep 2013 18:00:48 +0000 (20:00 +0200)
Problem:    Another valgrind error when using CTRL-X CTRL-F at the start of
            the line. (Dominique Pelle)
Solution:   Don't call mb_ptr_back() at the start of the line.  Add a test.

src/edit.c
src/testdir/test32.in
src/version.c

index b2b778729324b75922e201dab10354e28824e376..d2f058a985bee1300c5c45febd1b9433a0dc9c8d 100644 (file)
@@ -5183,15 +5183,19 @@ ins_complete(c)
        }
        else if (ctrl_x_mode == CTRL_X_FILES)
        {
-           char_u      *p = line + startcol;
-
            /* Go back to just before the first filename character. */
-           mb_ptr_back(line, p);
-           while (p > line && vim_isfilec(PTR2CHAR(p)))
+           if (startcol > 0)
+           {
+               char_u  *p = line + startcol;
+
                mb_ptr_back(line, p);
-           startcol = (int)(p - line) + 1;
-           if (p == line && vim_isfilec(PTR2CHAR(p)))
-               startcol = 0;
+               while (p > line && vim_isfilec(PTR2CHAR(p)))
+                   mb_ptr_back(line, p);
+               if (p == line && vim_isfilec(PTR2CHAR(p)))
+                   startcol = 0;
+               else
+                   startcol = (int)(p - line) + 1;
+           }
 
            compl_col += startcol;
            compl_length = (int)curs_col - startcol;
index 97e5c8b8b735c1ce96d0f65966c6487574bc11ae..6b399fa6c6a9b7d9dc4102fc1906632664ff3f20 100644 (file)
@@ -36,6 +36,9 @@ kOM\ e\18\ e\18\ e\18\18\18\10
 :w Xtest11.one
 :w Xtest11.two
 O\ e\eIX\eA\18\ 6\ e\e
+:" use CTRL-X CTRL-F to complete Xtest11.one, remove it and then use
+:" CTRL-X CTRL-F again to verify this doesn't cause trouble.
+OX\18\ 6\b\b\b\b\b\b\b\b\18\ 6\eddk
 :se cpt=w
 OST\ e\10\10\10\10\e
 :se cpt=u nohid
index f875d013d78902c3730990da8e44dab8bf29e599..ef3f9b1b6dc18f28ee306d137d9061c67603200c 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    27,
 /**/
     26,
 /**/