refactor/rename: path_is_absolute()

This commit is contained in:
Justin M. Keyes
2018-03-24 11:21:20 +01:00
parent 84a25770ac
commit 998a16c926
11 changed files with 54 additions and 58 deletions

View File

@@ -3020,20 +3020,17 @@ int resolve_symlink(const char_u *fname, char_u *buf)
}
buf[ret] = NUL;
/*
* Check whether the symlink is relative or absolute.
* If it's relative, build a new path based on the directory
* portion of the filename (if any) and the path the symlink
* points to.
*/
if (path_is_absolute_path(buf))
// Check whether the symlink is relative or absolute.
// If it's relative, build a new path based on the directory
// portion of the filename (if any) and the path the symlink
// points to.
if (path_is_absolute(buf)) {
STRCPY(tmp, buf);
else {
char_u *tail;
tail = path_tail(tmp);
if (STRLEN(tail) + STRLEN(buf) >= MAXPATHL)
} else {
char_u *tail = path_tail(tmp);
if (STRLEN(tail) + STRLEN(buf) >= MAXPATHL) {
return FAIL;
}
STRCPY(tail, buf);
}
}