From d25760774ae5d7ecb015abece1075044a8279d45 Mon Sep 17 00:00:00 2001 From: abdoulbari zaher <32519851+a-zakir@users.noreply.github.com> Date: Fri, 7 Jun 2024 19:43:08 +0200 Subject: [PATCH] fix c char* whitespace (#841) --- src/cpp/multisolver_interface/environment.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cpp/multisolver_interface/environment.cc b/src/cpp/multisolver_interface/environment.cc index 8aae173bc..dd7063680 100644 --- a/src/cpp/multisolver_interface/environment.cc +++ b/src/cpp/multisolver_interface/environment.cc @@ -20,6 +20,8 @@ #include #include #include + +#include "StringManip.h" namespace LoadXpress { #define STRINGIFY2(X) #X @@ -244,7 +246,11 @@ std::string XpressLoader::GetXpressVarFromEnvironmentVariables( xpress_home_from_env = path; } #endif - return xpress_home_from_env; + if (auto env_var_size = xpress_home_from_env.size(); env_var_size > 0) { + return xpress_home_from_env.substr(0, env_var_size - 1); + } else { + xpress_home_from_env; + } } std::vector XpressLoader::XpressDynamicLibraryPotentialPaths() {