diff options
| author | Karl Heuer | 1999-01-12 21:58:08 +0000 |
|---|---|---|
| committer | Karl Heuer | 1999-01-12 21:58:08 +0000 |
| commit | f6bf1c83d76a674ba316c1d7285e25058f399441 (patch) | |
| tree | ab011e04e7ef9e5704b7463502b0f34dcadd65bd /lib-src | |
| parent | 8de85318d84560083ab663f30042d1a775fae7bd (diff) | |
| download | emacs-f6bf1c83d76a674ba316c1d7285e25058f399441.tar.gz emacs-f6bf1c83d76a674ba316c1d7285e25058f399441.zip | |
(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) | |||
| 4714 | while (*fp++ == *dp++) | 4714 | while (*fp++ == *dp++) |
| 4715 | continue; | 4715 | continue; |
| 4716 | fp--, dp--; /* back to the first differing char */ | 4716 | fp--, dp--; /* back to the first differing char */ |
| 4717 | do /* look at the equal chars until '/' */ | 4717 | do { /* look at the equal chars until '/' */ |
| 4718 | if (fp == abs) return abs; /* first char differs, give up */ | ||
| 4718 | fp--, dp--; | 4719 | fp--, dp--; |
| 4719 | while (*fp != '/'); | 4720 | } while (*fp != '/'); |
| 4720 | 4721 | ||
| 4721 | /* Build a sequence of "../" strings for the resulting relative file name. */ | 4722 | /* Build a sequence of "../" strings for the resulting relative file name. */ |
| 4722 | i = 0; | 4723 | i = 0; |