Bug#507116: Vim fails to parse tags lines longer than 512 bytes

Bram Moolenaar Bram at moolenaar.net
Sun Dec 7 11:52:59 UTC 2008


James -

> On Sat, Dec 06, 2008 at 02:21:48PM +0100, Bram Moolenaar wrote:
> > > If a tags file has a line that's longer than 512 bytes (as is the case
> > > with the attached file), Vim won't be able to parse the tags file
> > > resulting in any :ts (or related) commands failing with E431.  As an
> > > example, try ":ts cli_parse_add" with the attached tags file.
> > 
> > There is a hard limit for tags file lines at 512 bytes.
> 
> I notice that the buffer for tags is already being dynamically
> allocated.  Is there a reason why the buffer isn't reallocated if the
> tag doesn't fit in 512 bytes?

There is a chicken-egg problem: the buffer has to be there before you
can call fgets().  There is a way around that, but makes things more
complicated.  And so far it worked fine.

> > I think we can safely ignore long lines.  Some tags may not be found,
> > but that's better than not finding anything.
> > 
> > Try the patch below.
> 
> This works well.

I'll probably send it out the coming week.

- Bram

-- 
CRONE:  Who sent you?
ARTHUR: The Knights Who Say Ni!
CRONE:  Aaaagh!  (she looks around in rear) No!  We have no shrubberies here.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///





More information about the pkg-vim-maintainers mailing list