(relative_filename): Stop backward search at beginning
of string, since non-Unix systems can have absolute paths with no initial slash.
This commit is contained in:
parent
8de85318d8
commit
f6bf1c83d7
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue