diff options
author | Karl Heuer <kwzh@gnu.org> | 1999-01-12 21:58:08 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1999-01-12 21:58:08 +0000 |
commit | f6bf1c83d76a674ba316c1d7285e25058f399441 (patch) | |
tree | ab011e04e7ef9e5704b7463502b0f34dcadd65bd /lib-src | |
parent | 8de85318d84560083ab663f30042d1a775fae7bd (diff) | |
download | emacs-f6bf1c83d76a674ba316c1d7285e25058f399441.tar.gz |
(relative_filename): Stop backward search at beginning
of string, since non-Unix systems can have absolute paths with no
initial slash.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/etags.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 22e6d35ae10..b838d90b636 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -4714,9 +4714,10 @@ relative_filename (file, dir) 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; |