[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: etags segfault
From: |
Francesco Potorti` |
Subject: |
Re: etags segfault |
Date: |
Mon, 25 Aug 2008 09:56:40 +0200 |
I fixed etags' segfault on the trunk. Sorry, my regression tests did
not cover this case. The cure is simply to allocate space in memory
rather than using static strings. I did not use the patch below,
because if leaves tagfiledir uninitialised in the first case.
>Index: lib-src/etags.c
>===================================================================
>RCS file: /sources/emacs/emacs/lib-src/etags.c,v
>retrieving revision 3.89
>diff -c -r3.89 etags.c
>*** lib-src/etags.c 16 Aug 2008 23:57:41 -0000 3.89
>--- lib-src/etags.c 23 Aug 2008 20:03:06 -0000
>***************
>*** 1250,1257 ****
> /* NOTREACHED */
> }
>
>- if (tagfile == NULL)
>- tagfile = CTAGS ? "tags" : "TAGS";
> cwd = etags_getcwd (); /* the current working directory */
> if (cwd[strlen (cwd) - 1] != '/')
> {
>--- 1250,1255 ----
>***************
>*** 1260,1267 ****
> free (oldcwd);
> }
> /* Relative file names are made relative to the current directory. */
>! if (streq (tagfile, "-")
>! || strneq (tagfile, "/dev/", 5))
> tagfiledir = cwd;
> else
> {
>--- 1258,1267 ----
> free (oldcwd);
> }
> /* Relative file names are made relative to the current directory. */
>! if (tagfile == NULL)
>! tagfile = CTAGS ? "tags" : "TAGS";
>! else if (streq (tagfile, "-")
>! || strneq (tagfile, "/dev/", 5))
> tagfiledir = cwd;
> else
> {
- etags segfault, Kenichi Handa, 2008/08/21
- Re: etags segfault,
Francesco Potorti` <=