From d13ba046b01fefa1fe5242d375fc949969915ef4 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 2 Feb 2022 19:25:40 +0100 Subject: [PATCH] resolve: Use the new real path This failed for /bin/foo/bar if /bin is a symlink to /usr/bin and foo doesn't exist. It returned /bin/foo/bar instead of the correct /usr/bin/foo/bar. --- src/builtins/path.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/builtins/path.cpp b/src/builtins/path.cpp index b930a5c62..de6a28c33 100644 --- a/src/builtins/path.cpp +++ b/src/builtins/path.cpp @@ -643,9 +643,9 @@ static int path_resolve(parser_t &parser, io_streams_t &streams, int argc, const next = wdirname(next); real = wrealpath(next); if (real) { - next.push_back(L'/'); - next.append(rest); - real = normalize_path(next, false); + real->push_back(L'/'); + real->append(rest); + real = normalize_path(*real, false); break; } rest = wbasename(next) + L'/' + rest;