aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2003-06-02 13:31:16 +0000
committerMax Khon <fjoe@FreeBSD.org>2003-06-02 13:31:16 +0000
commit401da56c0ffd3d7f4bcfbee6574a3cfb6d921a0b (patch)
treec886c209bf62c74907dc00c04ee58f049a37c28a /lib/libc/stdlib
parentc6c1f70ac1159d873b810cd186c5fb8f05046641 (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/realpath.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index 9dbb9b9269dd..8313a2749791 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -117,7 +117,7 @@ realpath(const char *path, char resolved[PATH_MAX])
*/
if (resolved_len > 1) {
resolved[resolved_len - 1] = '\0';
- q = strrchr(resolved, '/');
+ q = strrchr(resolved, '/') + 1;
*q = '\0';
resolved_len = q - resolved;
}
@@ -156,7 +156,7 @@ realpath(const char *path, char resolved[PATH_MAX])
} else if (resolved_len > 1) {
/* Strip the last path component. */
resolved[resolved_len - 1] = '\0';
- q = strrchr(resolved, '/');
+ q = strrchr(resolved, '/') + 1;
*q = '\0';
resolved_len = q - resolved;
}