From df24b993034e0d7b6f6dc05e75196bceb8d11a63 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 2 Aug 2024 22:41:42 -0500 Subject: [PATCH] updated build system --- support/3rd_party/src/utils/path.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/support/3rd_party/src/utils/path.cpp b/support/3rd_party/src/utils/path.cpp index 062be08d..08cd1c60 100644 --- a/support/3rd_party/src/utils/path.cpp +++ b/support/3rd_party/src/utils/path.cpp @@ -42,15 +42,17 @@ static const std::wstring directory_seperator_str_w{ #if defined(HAS_WORDEXP_H) try { - wordexp_t wt{}; - int ret{}; - if ((ret = wordexp(path.c_str(), &wt, 0)) != 0) { - throw std::runtime_error("'wordexp()' failed|" + std::to_string(ret) + - '|' + path); - } + if (not path.empty()) { + wordexp_t wt{}; + int ret{}; + if ((ret = wordexp(path.c_str(), &wt, 0)) != 0) { + throw std::runtime_error("'wordexp()' failed|" + std::to_string(ret) + + '|' + path); + } - path = wt.we_wordv[0U]; - wordfree(&wt); + path = wt.we_wordv[0U]; + wordfree(&wt); + } } catch (const std::exception &e) { repertory::utils::error::handle_exception(function_name, e); } catch (...) {