Subject: bug#32 closed by Stefan Monnier <[email-masked]> (Re: Bug in etags ".." code)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#32: Bug in etags ".." code

It has been closed by Stefan Monnier <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Stefan Monnier <[email-masked]> by
replying to this email.

-- 
32: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Thu May 29 13:18:52 2008
From: Stefan Monnier <[email-masked]>
To: [email-masked]
Subject: Re: Bug in etags ".." code
Date: Thu, 29 May 2008 16:18:48 -0400

Thanks, installed,

        Stefan

>From [email-masked] Sun Mar  2 19:10:35 2008
Resent-Message-ID: <[email-masked]>
Resent-To: [email-masked]
Resent-From: Stefan Monnier <[email-masked]>
Resent-Date: Sun, 02 Mar 2008 22:10:15 -0500
To: [email-masked]
From: Tom Tromey <[email-masked]>
Date: Sun, 02 Mar 2008 17:02:48 -0700
Subject: Bug in etags ".." code
Reply-To: Tom Tromey <[email-masked]>
Sender: bug-gnu-emacs-bounces+monnier=[email-masked]

I ran etags like this:

etags ./eval.c -o $(pwd)//.retags.d/Q

Note the double "/".

The resulting tags file contains this line:

../../eval.c,567

But this is wrong, there should be only a single "..".

I think relative_filename needs to handle the situation where multiple
"/"s appear consecutively.  The appended patch worked for me.

Tom

*** etags.c	07 Feb 2008 19:34:52 -0700	3.82
--- etags.c	02 Mar 2008 17:01:30 -0700	
***************
*** 6792,6799 ****
  
    /* Build a sequence of "../" strings for the resulting relative file name. */
    i = 0;
    while ((dp = etags_strchr (dp + 1, '/')) != NULL)
!     i += 1;
    res = xnew (3*i + strlen (fp + 1) + 1, char);
    res[0] = '\0';
    while (i-- > 0)
--- 6792,6805 ----
  
    /* Build a sequence of "../" strings for the resulting relative file name. */
    i = 0;
+   while (*dp == '/')
+     ++dp;
    while ((dp = etags_strchr (dp + 1, '/')) != NULL)
!     {
!       i += 1;
!       while (*dp == '/')
! 	++dp;
!     }
    res = xnew (3*i + strlen (fp + 1) + 1, char);
    res[0] = '\0';
    while (i-- > 0)