diff src/ex_getln.c @ 2630:0de47f0d731e v7.3.051

updated for version 7.3.051 Problem: Crash when /home/mool/bin:/usr/local/sbin:/usr/local/bin:/home/mool/java/jdk/bin:/bin:/sbin:/usr/bin:/usr/games:/usr/sbin:/usr/X11R6/bin:/usr/local/linux-jdk1.3.1/bin:/usr/local/lib/python2.2/Tools/idle is empty. Solution: Check for vim_getenv() returning NULL. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Wed, 10 Nov 2010 15:37:05 +0100
parents f2927225367a
children 6ee9d7fa5df6
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4747,7 +4747,11 @@ expand_shellcmd(filepat, num_file, file,
 			    || (pat[1] == '.' && vim_ispathsep(pat[2])))))
 	path = (char_u *)".";
     else
+    {
 	path = vim_getenv((char_u *)"PATH", &mustfree);
+	if (path == NULL)
+	    path = (char_u *)"";
+    }
 
     /*
      * Go over all directories in $PATH.  Expand matches in that directory and