util-lib: accept invoking chase_symlinks() with a NULL return parameter
Let's permit invoking chase_symlinks() with a NULL return parameter. If so, the resolved name is not returned, and call is useful for checking for existance of a file, without actually returning its ultimate path.
This commit is contained in:
parent
dee22f3970
commit
245f1d244b
|
@ -799,8 +799,10 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags,
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
*ret = done;
|
||||
done = NULL;
|
||||
if (ret) {
|
||||
*ret = done;
|
||||
done = NULL;
|
||||
}
|
||||
|
||||
return exists;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue