From d72e30af12da31cf60a2cd0701e75b4fb1e80e86 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Sun, 27 Aug 2023 21:46:16 -0400 Subject: [PATCH] Fix paths with spaces --- src/symbols/symbols_with_addr2line.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/symbols/symbols_with_addr2line.cpp b/src/symbols/symbols_with_addr2line.cpp index bfed19f..2d70977 100644 --- a/src/symbols/symbols_with_addr2line.cpp +++ b/src/symbols/symbols_with_addr2line.cpp @@ -263,13 +263,13 @@ namespace cpptrace { // TODO: Popen is a hack. Implement properly with CreateProcess and pipes later. ///fprintf(stderr, ("addr2line -e " + executable + " -fCp " + addresses + "\n").c_str()); #ifdef CPPTRACE_ADDR2LINE_SEARCH_SYSTEM_PATH - FILE* p = popen(("addr2line -e " + executable + " -fCp " + addresses).c_str(), "r"); + FILE* p = popen(("addr2line -e \"" + executable + "\" -fCp " + addresses).c_str(), "r"); #else #ifndef CPPTRACE_ADDR2LINE_PATH #error "CPPTRACE_ADDR2LINE_PATH must be defined if CPPTRACE_ADDR2LINE_SEARCH_SYSTEM_PATH is not" #endif FILE* p = popen( - (CPPTRACE_ADDR2LINE_PATH " -e " + executable + " -fCp " + addresses).c_str(), + (CPPTRACE_ADDR2LINE_PATH " -e \"" + executable + "\" -fCp " + addresses).c_str(), "r" ); #endif