From 33e97b33a87d557fd0916fc7503965503619c253 Mon Sep 17 00:00:00 2001 From: Carlos Espa Date: Tue, 14 Nov 2023 20:04:55 +0100 Subject: [PATCH] WIP --- src/util.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.cc b/src/util.cc index d971bd42abb9ca..4c7a86e7aaa302 100644 --- a/src/util.cc +++ b/src/util.cc @@ -760,8 +760,9 @@ std::string PathResolve(Environment* env, // the drive cwd is not available. We're sure the device is not // a UNC path at this points, because UNC paths are always absolute. std::string resolvedDevicePath; - credentials::SafeGetenv("=" + resolvedDevice); - path = resolvedDevicePath || env->GetCwd(); + const std::string envvar = "=" + resolvedDevice; + credentials::SafeGetenv(envvar.c_str(), &resolvedDevicePath); + path = resolvedDevicePath.empty() ? env->GetCwd() : resolvedDevicePath; // Verify that a cwd was found and that it actually points // to our drive. If not, default to the drive's root.