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

Vim 6.0: crash when LANG not set

Expand Messages
  • Dany St-Amant
    Hi, On MacOS X, I encountered a small problem in mbyte.c. It was due to the fact that the environment variable LANG is not set under MacOS X. A patch avoiding
    Message 1 of 3 , Oct 20, 2001
      Hi,

      On MacOS X, I encountered a small problem in mbyte.c. It was due to the
      fact that
      the environment variable LANG is not set under MacOS X. A patch avoiding
      the
      crash is included, but I don't know to what the encoding should really
      be defaulted to.

      *** ../vim60_ori/src/mbyte.c Wed Sep 26 10:18:24 2001
      --- src/mbyte.c Sat Oct 20 21:56:49 2001
      ***************
      *** 2348,2354 ****
      # endif
      if ((s = getenv("LC_ALL")) == NULL || *s == NUL)
      if ((s = getenv("LC_CTYPE")) == NULL || *s == NUL)
      ! s = getenv("LANG");

      /* The most generic locale format is:
      *
      language[_territory][.codeset][@modifier][+special][,[sponsor]
      [_revision]]
      --- 2348,2355 ----
      # endif
      if ((s = getenv("LC_ALL")) == NULL || *s == NUL)
      if ((s = getenv("LC_CTYPE")) == NULL || *s == NUL)
      ! if ((s = getenv("LANG")) == NULL || *s == NUL)
      ! s = "latin1";

      /* The most generic locale format is:
      *
      language[_territory][.codeset][@modifier][+special][,[sponsor]
      [_revision]]
    • Eugene Lee
      ... My LANG is by default set to en , but I m using /bin/bash (which I built myself a while ago). And even when I unset LANG, I don t get any kind of crash.
      Message 2 of 3 , Oct 21, 2001
        On Sat, Oct 20, 2001 at 10:13:04PM -0400, Dany St-Amant wrote:
        :
        : On MacOS X, I encountered a small problem in mbyte.c. It was due to the
        : fact that the environment variable LANG is not set under MacOS X. A
        : patch avoiding the crash is included, but I don't know to what the
        : encoding should really be defaulted to.

        My LANG is by default set to "en", but I'm using /bin/bash (which I
        built myself a while ago). And even when I unset LANG, I don't get any
        kind of crash. Thoughts?


        --
        Eugene Lee
        eugene@...
      • Bram Moolenaar
        ... Good point. This may happen on more systems, especially if setlocale() isn t supported. I notice the comment for this function is also wrong. I ll make a
        Message 3 of 3 , Oct 21, 2001
          Dany St-Amant wrote:

          > On MacOS X, I encountered a small problem in mbyte.c. It was due to the
          > fact that the environment variable LANG is not set under MacOS X. A
          > patch avoiding the crash is included, but I don't know to what the
          > encoding should really be defaulted to.

          Good point. This may happen on more systems, especially if setlocale()
          isn't supported. I notice the comment for this function is also wrong.
          I'll make a patch for it.

          --
          hundred-and-one symptoms of being an internet addict:
          138. You develop a liking for cold coffee.

          /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
          ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
          \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
        Your message has been successfully submitted and would be delivered to recipients shortly.