changeset 24059:f1c7db535d31

(relative_filename): Stop backward search at beginning of string, since non-Unix systems can have absolute paths with no initial slash.
author Karl Heuer <kwzh@gnu.org>
date Tue, 12 Jan 1999 21:58:08 +0000
parents 85622273d1e8
children 7fbcc57e9f56
files lib-src/etags.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/etags.c	Tue Jan 12 21:50:44 1999 +0000
+++ b/lib-src/etags.c	Tue Jan 12 21:58:08 1999 +0000
@@ -4714,9 +4714,10 @@
   while (*fp++ == *dp++)
     continue;
   fp--, dp--;			/* back to the first differing char */
-  do				/* look at the equal chars until '/' */
+  do {				/* look at the equal chars until '/' */
+    if (fp == abs) return abs;	/* first char differs, give up */
     fp--, dp--;
-  while (*fp != '/');
+  } while (*fp != '/');
 
   /* Build a sequence of "../" strings for the resulting relative file name. */
   i = 0;