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

64922Re: vimgrep fails when 'autochdir' is set

Expand Messages
  • Bram Moolenaar
    Apr 25, 2012
    • 0 Attachment
      Benjamin Fritz wrote in February:

      > Updated patch attached to fix that 'autochdir' causes :vimgrep to
      > fail, based on 7.3.421. I did have one more question: I noticed that
      > the pre-existing code dynamically allocates memory of static size
      > MAXPATHL for both dirname_start and dirname_now. I have kept this and
      > done the same thing for the restore_start_dir function I added, but I
      > wonder, is there a reason the path string cannot be stack-allocated
      > instead? Is it to limit stack size or something, since MAXPATHL can be
      > somewhat large?

      Running out of stack space usually causes a nasty crash. Can't even
      save the swap file then, unless the system supports a signal stack.
      Therefore Vim avoids putting large buffers on the stack. MAXPATHL is
      often 4000 or 8000 bytes, which is quite a lot. Especially when doing
      it in many places.

      MONK: ... and the Lord spake, saying, "First shalt thou take out the Holy Pin,
      then shalt thou count to three, no more, no less. Three shalt be the
      number thou shalt count, and the number of the counting shalt be three.
      Four shalt thou not count, neither count thou two, excepting that thou
      then proceed to three. Five is right out. Once the number three, being
      the third number, be reached, then lobbest thou thy Holy Hand Grenade of
      Antioch towards thou foe, who being naughty in my sight, shall snuff it.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

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