]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.589 v7.3.589
authorBram Moolenaar <Bram@vim.org>
Fri, 6 Jul 2012 14:49:40 +0000 (16:49 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 6 Jul 2012 14:49:40 +0000 (16:49 +0200)
Problem:    Crash when $HOME is not set.
Solution:   Check for a NULL pointer. (Chris Webb)

src/misc1.c
src/version.c

index 99881dccdfc7ea0e0ff1946fdbbb79b285b80adf..34822720600ec7c56433b78d04aac52182c15d2a 100644 (file)
@@ -4496,8 +4496,12 @@ home_replace(buf, src, dst, dstlen, one)
 #else
     homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
 #endif
+    /* Empty is the same as not set. */
+    if (homedir_env != NULL && *homedir_env == NUL)
+       homedir_env = NULL;
+
 #if defined(FEAT_MODIFY_FNAME) || defined(WIN3264)
-    if (vim_strchr(homedir_env, '~') != NULL)
+    if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL)
     {
        int     usedlen = 0;
        int     flen;
@@ -4513,8 +4517,6 @@ home_replace(buf, src, dst, dstlen, one)
     }
 #endif
 
-    if (homedir_env != NULL && *homedir_env == NUL)
-       homedir_env = NULL;
     if (homedir_env != NULL)
        envlen = STRLEN(homedir_env);
 
index 2676fa7fc8712ec50206f70f0d153c60feeae071..0acbce0abfd608011716de829cde1b5f5c4f5d2e 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    589,
 /**/
     588,
 /**/