1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Crash when $PATH is empty.
12 Solution: Check for vim_getenv() returning NULL. (Yasuhiro Matsumoto)
13 Files: src/ex_getln.c, src/os_win32.c
16 *** ../vim-7.3.050/src/ex_getln.c 2010-10-27 12:58:19.000000000 +0200
17 --- src/ex_getln.c 2010-11-10 15:31:33.000000000 +0100
21 || (pat[1] == '.' && vim_ispathsep(pat[2])))))
25 path = vim_getenv((char_u *)"PATH", &mustfree);
27 + path = (char_u *)"";
31 * Go over all directories in $PATH. Expand matches in that directory and
32 *** ../vim-7.3.050/src/os_win32.c 2010-10-27 12:17:54.000000000 +0200
33 --- src/os_win32.c 2010-11-10 15:30:36.000000000 +0100
39 ! char temp[MAXPATHL];
44 /* store the name of the executable, may be used for $VIM */
45 ! GetModuleFileName(NULL, temp, MAXPATHL - 1);
47 exe_name = FullName_save((char_u *)temp, FALSE);
53 ! /* Maximum length of $PATH is more than MAXPATHL. 8191 is often mentioned
54 ! * as the maximum length that works (plus a NUL byte). */
55 ! #define MAX_ENV_PATH_LEN 8192
56 ! char temp[MAX_ENV_PATH_LEN];
61 /* store the name of the executable, may be used for $VIM */
62 ! GetModuleFileName(NULL, temp, MAX_ENV_PATH_LEN - 1);
64 exe_name = FullName_save((char_u *)temp, FALSE);
68 * "!xxd" it's found in our starting directory. Needed because
69 * SearchPath() also looks there. */
70 p = mch_getenv("PATH");
71 ! if (STRLEN(p) + STRLEN(exe_path) + 2 < MAXPATHL)
75 STRCAT(temp, exe_path);
76 vim_setenv((char_u *)"PATH", temp);
79 * "!xxd" it's found in our starting directory. Needed because
80 * SearchPath() also looks there. */
81 p = mch_getenv("PATH");
83 ! || STRLEN(p) + STRLEN(exe_path) + 2 < MAX_ENV_PATH_LEN)
85 ! if (p == NULL || *p == NUL)
92 STRCAT(temp, exe_path);
93 vim_setenv((char_u *)"PATH", temp);
95 *** ../vim-7.3.050/src/version.c 2010-11-03 22:32:18.000000000 +0100
96 --- src/version.c 2010-11-10 15:34:43.000000000 +0100
100 { /* Add new patch number below this line */
106 SIGFUN -- signature too funny (core dumped)
108 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
109 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
110 \\\ download, build and distribute -- http://www.A-A-P.org ///
111 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///