From 33af7075e7624c1e30dc4a52039e2f6bf3fc5823 Mon Sep 17 00:00:00 2001 From: Valtteri Koskivuori Date: Fri, 7 May 2021 23:05:05 +0300 Subject: =?UTF-8?q?Userland:=20Remove=20extra=20slashes=20from=20`find`?= =?UTF-8?q?=C2=A0output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I noticed while testing `find` that the output of `find` contains extra forward slashes if the root path has a trailing slash. This patch fixes that issue by passing the root path through LexicalPath before proceeding. --- Userland/Utilities/find.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Utilities') diff --git a/Userland/Utilities/find.cpp b/Userland/Utilities/find.cpp index 700d0a50ca..196656ab1d 100644 --- a/Userland/Utilities/find.cpp +++ b/Userland/Utilities/find.cpp @@ -465,8 +465,8 @@ static void walk_tree(const char* root_path, Command& command) int main(int argc, char* argv[]) { - auto root_path = parse_options(argc, argv); + LexicalPath root_path(parse_options(argc, argv)); auto command = parse_all_commands(argv); - walk_tree(root_path, *command); + walk_tree(root_path.string().characters(), *command); return g_there_was_an_error ? 1 : 0; } -- cgit v1.2.3