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

60321Re: Useless error check

Expand Messages
  • Bram Moolenaar
    Feb 3, 2011
    • 0 Attachment
      Ben Schmidt wrote:

      > It came up in a private conversation I had that this line in
      > get_varp() is useless:
      > default: EMSG(_("E356: get_varp ERROR"));
      > The reason is that the first time it is called, it is because
      > set_options_default is running at initialisation time, and since this
      > happens in alphabetical order, almost every option is initialised
      > before 'verbosefile' is.
      > But EMSG eventually checks 'verbosefile' (p_vfile) to write to it, and
      > in so doing, it segfaults (in redir_write).
      > The patch below fixes it. Don't know if it's worth the bother, though.

      With this solution other calls to EMSG() too early would still fail.
      Perhaps we can better check if p_vfile is NULL? And make sure it's NULL
      to start with.

      So many things happen startup that it's difficult to avoid mistakes...

      hundred-and-one symptoms of being an internet addict:
      190. You quickly hand over your wallet, leather jacket, and car keys
      during a mugging, then proceed to beat the crap out of your
      assailant when he asks for your laptop.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      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 3 messages in this topic