1
0
forked from aniani/vim

updated for version 7.3.589

Problem:    Crash when $HOME is not set.
Solution:   Check for a NULL pointer. (Chris Webb)
This commit is contained in:
Bram Moolenaar
2012-07-06 16:49:40 +02:00
parent 756287da38
commit bef4790c23
2 changed files with 7 additions and 3 deletions

View File

@@ -4496,8 +4496,12 @@ home_replace(buf, src, dst, dstlen, one)
#else #else
homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME"); homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
#endif #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 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 usedlen = 0;
int flen; int flen;
@@ -4513,8 +4517,6 @@ home_replace(buf, src, dst, dstlen, one)
} }
#endif #endif
if (homedir_env != NULL && *homedir_env == NUL)
homedir_env = NULL;
if (homedir_env != NULL) if (homedir_env != NULL)
envlen = STRLEN(homedir_env); envlen = STRLEN(homedir_env);

View File

@@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
589,
/**/ /**/
588, 588,
/**/ /**/