changeset 5345:9085d32d7424 v7.4.025

updated for version 7.4.025 Problem: Reading before start of a string. Solution: Do not call mb_ptr_back() at start of a string. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Sun, 08 Sep 2013 16:03:45 +0200
parents a62a2fb4d487
children 3530261cb77b
files src/edit.c src/version.c
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -5187,11 +5187,13 @@ ins_complete(c)
 
 	    /* Go back to just before the first filename character. */
 	    mb_ptr_back(line, p);
-	    while (vim_isfilec(PTR2CHAR(p)) && p >= line)
+	    while (p > line && vim_isfilec(PTR2CHAR(p)))
 		mb_ptr_back(line, p);
-	    startcol = (int)(p - line);
-
-	    compl_col += ++startcol;
+	    startcol = (int)(p - line) + 1;
+	    if (p == line && vim_isfilec(PTR2CHAR(p)))
+		startcol = 0;
+
+	    compl_col += startcol;
 	    compl_length = (int)curs_col - startcol;
 	    compl_pattern = addstar(line + compl_col, compl_length,
 								EXPAND_FILES);
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    25,
+/**/
     24,
 /**/
     23,