]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.512 v7.3.512
authorBram Moolenaar <Bram@vim.org>
Mon, 30 Apr 2012 15:35:48 +0000 (17:35 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 30 Apr 2012 15:35:48 +0000 (17:35 +0200)
Problem:    undofile() returns a useless name when passed an empty string.
Solution:   Return an empty string. (Christian Brabandt)

src/eval.c
src/version.c

index 4d45ae2574091caf8c6585e2ebe562a5a7e3212b..fa9966e7ee562a15c61d04e03f9ea92872e13a32 100644 (file)
@@ -18259,11 +18259,21 @@ f_undofile(argvars, rettv)
     rettv->v_type = VAR_STRING;
 #ifdef FEAT_PERSISTENT_UNDO
     {
-       char_u *ffname = FullName_save(get_tv_string(&argvars[0]), FALSE);
+       char_u *fname = get_tv_string(&argvars[0]);
 
-       if (ffname != NULL)
-           rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
-       vim_free(ffname);
+       if (*fname == NUL)
+       {
+           /* If there is no file name there will be no undo file. */
+           rettv->vval.v_string = NULL;
+       }
+       else
+       {
+           char_u *ffname = FullName_save(fname, FALSE);
+
+           if (ffname != NULL)
+               rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
+           vim_free(ffname);
+       }
     }
 #else
     rettv->vval.v_string = NULL;
index b2f9a986b284a4f882e4e4bf97e8b76dcae7413b..ce22d9f99cef87950b6ab447c15e36b40c5bf0e4 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    512,
 /**/
     511,
 /**/