summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/realpath.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1995-02-25 16:06:07 +0000
committerBruce Evans <bde@FreeBSD.org>1995-02-25 16:06:07 +0000
commit5dddb8148b1b03724e670d3870b8029be79e9449 (patch)
tree6c465518461b807028655496e6a9ff44e69338e8 /lib/libc/stdlib/realpath.c
parent386094e3051b421c4d9fb4c102ac9e958f1612a3 (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/realpath.c')
-rw-r--r--lib/libc/stdlib/realpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index 20efabdd28c0..28380d72183a 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -98,7 +98,7 @@ loop:
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)