Karsten Hopp a5ba91
To: vim_dev@googlegroups.com
Karsten Hopp a5ba91
Subject: Patch 7.3.589
Karsten Hopp a5ba91
Fcc: outbox
Karsten Hopp a5ba91
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp a5ba91
Mime-Version: 1.0
Karsten Hopp a5ba91
Content-Type: text/plain; charset=UTF-8
Karsten Hopp a5ba91
Content-Transfer-Encoding: 8bit
Karsten Hopp a5ba91
------------
Karsten Hopp a5ba91
Karsten Hopp a5ba91
Patch 7.3.589
Karsten Hopp a5ba91
Problem:    Crash when $HOME is not set.
Karsten Hopp a5ba91
Solution:   Check for a NULL pointer. (Chris Webb)
Karsten Hopp a5ba91
Files:	    src/misc1.c
Karsten Hopp a5ba91
Karsten Hopp a5ba91
Karsten Hopp a5ba91
*** ../vim-7.3.588/src/misc1.c	2012-06-29 15:04:34.000000000 +0200
Karsten Hopp a5ba91
--- src/misc1.c	2012-07-06 16:44:39.000000000 +0200
Karsten Hopp a5ba91
***************
Karsten Hopp a5ba91
*** 4496,4503 ****
Karsten Hopp a5ba91
  #else
Karsten Hopp a5ba91
      homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
Karsten Hopp a5ba91
  #endif
Karsten Hopp a5ba91
  #if defined(FEAT_MODIFY_FNAME) || defined(WIN3264)
Karsten Hopp a5ba91
!     if (vim_strchr(homedir_env, '~') != NULL)
Karsten Hopp a5ba91
      {
Karsten Hopp a5ba91
  	int	usedlen = 0;
Karsten Hopp a5ba91
  	int	flen;
Karsten Hopp a5ba91
--- 4496,4507 ----
Karsten Hopp a5ba91
  #else
Karsten Hopp a5ba91
      homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
Karsten Hopp a5ba91
  #endif
Karsten Hopp a5ba91
+     /* Empty is the same as not set. */
Karsten Hopp a5ba91
+     if (homedir_env != NULL && *homedir_env == NUL)
Karsten Hopp a5ba91
+ 	homedir_env = NULL;
Karsten Hopp a5ba91
+ 
Karsten Hopp a5ba91
  #if defined(FEAT_MODIFY_FNAME) || defined(WIN3264)
Karsten Hopp a5ba91
!     if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL)
Karsten Hopp a5ba91
      {
Karsten Hopp a5ba91
  	int	usedlen = 0;
Karsten Hopp a5ba91
  	int	flen;
Karsten Hopp a5ba91
***************
Karsten Hopp a5ba91
*** 4513,4520 ****
Karsten Hopp a5ba91
      }
Karsten Hopp a5ba91
  #endif
Karsten Hopp a5ba91
  
Karsten Hopp a5ba91
-     if (homedir_env != NULL && *homedir_env == NUL)
Karsten Hopp a5ba91
- 	homedir_env = NULL;
Karsten Hopp a5ba91
      if (homedir_env != NULL)
Karsten Hopp a5ba91
  	envlen = STRLEN(homedir_env);
Karsten Hopp a5ba91
  
Karsten Hopp a5ba91
--- 4517,4522 ----
Karsten Hopp a5ba91
*** ../vim-7.3.588/src/version.c	2012-07-06 16:39:43.000000000 +0200
Karsten Hopp a5ba91
--- src/version.c	2012-07-06 16:45:18.000000000 +0200
Karsten Hopp a5ba91
***************
Karsten Hopp a5ba91
*** 716,717 ****
Karsten Hopp a5ba91
--- 716,719 ----
Karsten Hopp a5ba91
  {   /* Add new patch number below this line */
Karsten Hopp a5ba91
+ /**/
Karsten Hopp a5ba91
+     589,
Karsten Hopp a5ba91
  /**/
Karsten Hopp a5ba91
Karsten Hopp a5ba91
-- 
Karsten Hopp a5ba91
I AM THANKFUL...
Karsten Hopp a5ba91
...for the taxes that I pay because it means that I am employed.
Karsten Hopp a5ba91
Karsten Hopp a5ba91
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp a5ba91
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp a5ba91
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp a5ba91
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///