From 0b676736a0e9ab4939c195a516aa7e82fcd839aa Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Thu, 21 Mar 2024 10:36:40 -0400 Subject: [PATCH] test: add missing cctest/test_path.cc PR-URL: https://github.com/nodejs/node/pull/52148 Reviewed-By: Richard Lau Reviewed-By: Geoffrey Booth Reviewed-By: Chemi Atlow Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca --- node.gyp | 1 + src/path.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/node.gyp b/node.gyp index e5ca012a822f34..4a2632c541c380 100644 --- a/node.gyp +++ b/node.gyp @@ -398,6 +398,7 @@ 'test/cctest/test_environment.cc', 'test/cctest/test_linked_binding.cc', 'test/cctest/test_node_api.cc', + 'test/cctest/test_path.cc', 'test/cctest/test_per_process.cc', 'test/cctest/test_platform.cc', 'test/cctest/test_report.cc', diff --git a/src/path.cc b/src/path.cc index 6a56b750d6e947..78dd5804fc391d 100644 --- a/src/path.cc +++ b/src/path.cc @@ -101,7 +101,7 @@ std::string PathResolve(Environment* env, const size_t numArgs = paths.size(); auto cwd = env->GetCwd(env->exec_path()); - for (int i = numArgs - 1; i >= -1 && !resolvedAbsolute; i--) { + for (int i = numArgs - 1; i >= -1; i--) { std::string path; if (i >= 0) { path = std::string(paths[i]);