Don't attempt to lstat() the POSIXLY invalid empty pathname.
realpath() still accepts "" as an arg and converts it to a canonical pathname for the current directory.
This commit is contained in:
parent
386094e305
commit
5dddb8148b
@ -98,7 +98,7 @@ realpath(path, resolved)
|
||||
p = resolved;
|
||||
|
||||
/* Deal with the last component. */
|
||||
if (lstat(p, &sb) == 0) {
|
||||
if (*p != '\0' && lstat(p, &sb) == 0) {
|
||||
if (S_ISLNK(sb.st_mode)) {
|
||||
n = readlink(p, resolved, MAXPATHLEN);
|
||||
if (n < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user