From da16ecc0024197713df0c31fcdb148675dabce34 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Fri, 11 Mar 2016 16:39:22 +0100 Subject: [PATCH] libc: remove trailing slash during file operations POSIX stipulates that a trailing '/' on a path is valid for any operation where the final path element is a directory. Fixes #1330 --- repos/libports/src/lib/libc/file_operations.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/repos/libports/src/lib/libc/file_operations.cc b/repos/libports/src/lib/libc/file_operations.cc index 317b816478..a1f95a4c67 100644 --- a/repos/libports/src/lib/libc/file_operations.cc +++ b/repos/libports/src/lib/libc/file_operations.cc @@ -185,6 +185,7 @@ static void resolve_symlinks(char const *path, Absolute_path &resolved_path) } while (symlink_resolved_in_this_iteration); resolved_path.import(next_iteration_working_path.base()); + resolved_path.remove_trailing('/'); PDBGV("resolved_path = %s", resolved_path.base()); }