summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
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 c269471..3082f5f 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;
}
OpenPOWER on IntegriCloud