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

60317Useless error check

Expand Messages
  • Ben Schmidt
    Feb 3, 2011
      Hi, Bram,

      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.


      diff -r 4ad7ccf65de3 src/option.c
      --- a/src/option.c Sun Jan 30 08:39:51 2011 +0100
      +++ b/src/option.c Fri Feb 04 03:35:56 2011 +1100
      @@ -3493,6 +3493,10 @@
      tabpage_T *tp;

      + /* Initialise p_vfile ('verbosefile') manually first, as if other
      + * initialisations cause errors, it is needed to display them. */
      + p_vfile = (char_u *)"";
      for (i = 0; !istermoption(&options[i]); i++)
      if (!(options[i].flags & P_NODEFAULT))
      set_option_default(i, opt_flags, p_cp);

      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