Loading ...
Sorry, an error occurred while loading the content.

61550Re: HOME variable in cmd.exe for vim compiled in an UNIX-like environment

Expand Messages
  • Fabian Greffrath
    Jun 1, 2011
    • 0 Attachment
      Am 31.05.2011 11:16, schrieb Gary Johnson:
      > Under what conditions does yours crash?

      Plain vim.exe from MSYS executed in a cmd.exe shell.

      I have seen something similar to your observations: If I unset HOME in
      cmd.exe (via "set HOME=") and then run vim.exe from MSYS, it crashes.
      If I first run bash and then start vim.exe from bash, it works, even
      if bash also has its HOME variable unset. Strange...

      However, currently the init_homedir function in misc1.c does not
      consider the case when both UNIX is defined at build time (#ifdef
      UNIX) but (var == NULL) at run time, which is perfectly possible when
      vim is compiled in an MSYS environment (which has __unix defined) but
      executed from a cmd.exe shell without a HOME variable.

      The attached short patch is very pragmatic but at least provides a
      fallback solution when the aforementioned case occures, else the
      init_homedir function may return and the homedir variable is still NULL.

      - Fabian


      --- misc1.c.orig
      +++ misc1.c
      @@ -3540,6 +3540,8 @@
      homedir = vim_strsave(var);
      + } else {
      + homedir = vim_strsave(".");

      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 20 messages in this topic