changeset 95393:c6d82cbe67bc

(relative_filename): Treat "///" like "/" in filenames.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 29 May 2008 20:18:07 +0000
parents 838b2bca5a6f
children 119c6508d4f8
files lib-src/ChangeLog lib-src/etags.c
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Thu May 29 20:05:36 2008 +0000
+++ b/lib-src/ChangeLog	Thu May 29 20:18:07 2008 +0000
@@ -1,3 +1,7 @@
+2008-05-29  Tom Tromey  <tromey@redhat.com>
+
+	* etags.c (relative_filename): Treat "///" like "/" in filenames.
+
 2008-05-09  Eli Zaretskii  <eliz@gnu.org>
 
 	* ntlib.c: Include sys/types.h, sys/stat.h, and errno.h.
--- a/lib-src/etags.c	Thu May 29 20:05:36 2008 +0000
+++ b/lib-src/etags.c	Thu May 29 20:18:07 2008 +0000
@@ -6790,8 +6790,14 @@
 
   /* 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;
+    {
+      i += 1;
+      while (*dp == '/')
+	++dp;
+    }
   res = xnew (3*i + strlen (fp + 1) + 1, char);
   res[0] = '\0';
   while (i-- > 0)