From 4bbdef278b030346b003663a70ce6e0ea459ee32 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 27 Oct 2018 22:02:36 +0200 Subject: [PATCH] try to please sonar on this ugly code --- src/xbt/backtrace.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xbt/backtrace.cpp b/src/xbt/backtrace.cpp index cd3c902bb7..ed512992a3 100644 --- a/src/xbt/backtrace.cpp +++ b/src/xbt/backtrace.cpp @@ -128,10 +128,11 @@ static std::string get_binary_path() char* path = getenv("PATH"); if (path == nullptr) return ""; + XBT_DEBUG("Looking in the PATH: %s\n", path); std::vector path_list; - // TODO, on Windows, this is ";" - boost::split(path_list, path, boost::is_any_of(":")); + boost::split(path_list, path, boost::is_any_of(":;")); + for (std::string const& path_item : path_list) { std::string binary_name = simgrid::xbt::string_printf("%s/%s", path_item.c_str(), xbt_binary_name); bool found = (stat(binary_name.c_str(), &stat_buf) == 0); @@ -341,7 +342,7 @@ std::vector resolve_backtrace(xbt_backtrace_location_t const* loc, break; } pclose(pipe); - free(backtrace_syms); + xbt_free(backtrace_syms); #endif /* ADDR2LINE usable to resolve the backtrace */ return result; } -- 2.20.1