summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2003-05-28 08:23:01 +0000
committerMax Khon <fjoe@FreeBSD.org>2003-05-28 08:23:01 +0000
commitf4203da86c97fb14101aee42509dcc755aefce62 (patch)
tree4086c738a8a4678ed1fdbbca3f8d6ab4bb5c64cd /lib/libc/stdlib
parent34d258e9058af1bbe2929c91b61e005927db3061 (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 c2694717a9e8..3082f5f4b95a 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -119,7 +119,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;
}
@@ -158,7 +158,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;
}