From ee93890d86ea2d4d0bf6cc31e9fdb5e68a52143c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 4 Feb 2024 20:58:38 -0600 Subject: [PATCH] Don't attempt to get the working directory of a URL --- src/process.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/process.cpp b/src/process.cpp index c01c60d1..fef585cd 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -118,7 +118,12 @@ namespace proc { return boost::filesystem::path(); } - BOOST_LOG(debug) << "Parsed executable ["sv << parts.at(0) << "] from command ["sv << cmd << ']'; + BOOST_LOG(debug) << "Parsed target ["sv << parts.at(0) << "] from command ["sv << cmd << ']'; + + // If the target is a URL, don't parse any further here + if (parts.at(0).find("://") != std::string::npos) { + return boost::filesystem::path(); + } // If the cmd path is not an absolute path, resolve it using our PATH variable boost::filesystem::path cmd_path(parts.at(0)); @@ -130,7 +135,7 @@ namespace proc { } } - BOOST_LOG(debug) << "Resolved executable ["sv << parts.at(0) << "] to path ["sv << cmd_path << ']'; + BOOST_LOG(debug) << "Resolved target ["sv << parts.at(0) << "] to path ["sv << cmd_path << ']'; // Now that we have a complete path, we can just use parent_path() return cmd_path.parent_path();