To: [email protected]
Subject: patch 5.4n.11
Fcc: outbox
From: Bram Moolenaar <[email protected]>
------------

Patch 5.4n.11
Problem:    When setting the 'helpfile' option, the $VIMRUNTIME environment
           variable could be reset.  Happened when it was first determined
           automatically and then given a value with ":let $VIMRUNTIME =".
           (John Mullin)
           After 'helpfile' was set, "echo $VIMRUNTIME" showed an empty
           string.
Solution:   Fix a typo in do_let(): didset_vim should be didset_vimruntime.
           When mch_getenv() returns an empty string, try to get its value
           from vim_getenv().
Files:      src/eval.c


*** ../vim-5.4n/src/eval.c      Sun Jul  4 20:35:42 1999
--- src/eval.c  Wed Jul  7 12:06:36 1999
***************
*** 443,449 ****
                           init_homedir();
                       else if (didset_vim && STRICMP(name, "VIM") == 0)
                           didset_vim = FALSE;
!                       else if (didset_vim && STRICMP(name, "VIMRUNTIME") == 0)
                           didset_vimruntime = FALSE;
                       name[len] = cc;
                   }
--- 443,450 ----
                           init_homedir();
                       else if (didset_vim && STRICMP(name, "VIM") == 0)
                           didset_vim = FALSE;
!                       else if (didset_vimruntime
!                                         && STRICMP(name, "VIMRUNTIME") == 0)
                           didset_vimruntime = FALSE;
                       name[len] = cc;
                   }
***************
*** 1779,1785 ****
           name[len] = NUL;
           /* first try mch_getenv(), fast for normal environment vars */
           string = mch_getenv(name);
!           if (string != NULL)
               string = vim_strsave(string);
           else
           {
--- 1780,1786 ----
           name[len] = NUL;
           /* first try mch_getenv(), fast for normal environment vars */
           string = mch_getenv(name);
!           if (string != NULL && *string != NUL)
               string = vim_strsave(string);
           else
           {

--
Females are strictly forbidden to appear unshaven in public.
               [real standing law in New Mexico, United States of America]

--/-/---- Bram Moolenaar ---- [email protected] ---- [email protected] ---\-\--
 \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /