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.
This commit is contained in:
Fabian Homborg 2022-02-02 19:25:40 +01:00
parent 80e04a1e86
commit d13ba046b0

View File

@ -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;