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