diff lib-src/etags.c @ 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 191fa10a366c
children 9e4d1d3eab09
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;