Skip to content

Commit 6d72979

Browse files
committed
updated for version 7.3.589
Problem: Crash when $HOME is not set. Solution: Check for a NULL pointer. (Chris Webb)
1 parent 9ca0ff1 commit 6d72979

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/misc1.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4496,8 +4496,12 @@ home_replace(buf, src, dst, dstlen, one)
44964496
#else
44974497
homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
44984498
#endif
4499+
/* Empty is the same as not set. */
4500+
if (homedir_env != NULL && *homedir_env == NUL)
4501+
homedir_env = NULL;
4502+
44994503
#if defined(FEAT_MODIFY_FNAME) || defined(WIN3264)
4500-
if (vim_strchr(homedir_env, '~') != NULL)
4504+
if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL)
45014505
{
45024506
int usedlen = 0;
45034507
int flen;
@@ -4513,8 +4517,6 @@ home_replace(buf, src, dst, dstlen, one)
45134517
}
45144518
#endif
45154519

4516-
if (homedir_env != NULL && *homedir_env == NUL)
4517-
homedir_env = NULL;
45184520
if (homedir_env != NULL)
45194521
envlen = STRLEN(homedir_env);
45204522

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ static char *(features[]) =
714714

715715
static int included_patches[] =
716716
{ /* Add new patch number below this line */
717+
/**/
718+
589,
717719
/**/
718720
588,
719721
/**/

0 commit comments

Comments
 (0)