diff --git a/src/path.cc b/src/path.cc index f1813596ff78ff..df6a11644b4c1a 100644 --- a/src/path.cc +++ b/src/path.cc @@ -266,11 +266,11 @@ std::string PathResolve(Environment* env, for (int i = numArgs - 1; i >= -1 && !resolvedAbsolute; i--) { const std::string& path = (i >= 0) ? std::string(paths[i]) : cwd; - if (static_cast(i) == numArgs - 1 && path.back() == '/') { - slashCheck = true; - } - if (!path.empty()) { + if (static_cast(i) == numArgs - 1 && path.back() == '/') { + slashCheck = true; + } + resolvedPath = std::string(path) + "/" + resolvedPath; if (path.front() == '/') {