mirror of
https://github.com/boostorg/stacktrace.git
synced 2026-01-21 17:32:15 +00:00
Trim null characters on Windows (fixes #78)
This commit is contained in:
@@ -98,7 +98,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
static std::string mingw_demangling_workaround(const std::string& s) {
|
||||
inline std::string mingw_demangling_workaround(const std::string& s) {
|
||||
#ifdef BOOST_GCC
|
||||
if (s.empty()) {
|
||||
return s;
|
||||
@@ -114,6 +114,12 @@ static std::string mingw_demangling_workaround(const std::string& s) {
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void trim_right_zeroes(std::string& s) {
|
||||
while (s.back() == '\0') {
|
||||
s.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
class debugging_symbols: boost::noncopyable {
|
||||
static void try_init_com(com_holder< ::IDebugSymbols>& idebug, const com_global_initer& com) BOOST_NOEXCEPT {
|
||||
com_holder< ::IDebugClient> iclient(com);
|
||||
@@ -217,6 +223,7 @@ public:
|
||||
&size,
|
||||
0
|
||||
));
|
||||
trim_right_zeroes(result);
|
||||
} else if (res) {
|
||||
result = name;
|
||||
}
|
||||
@@ -301,6 +308,7 @@ public:
|
||||
&size,
|
||||
0
|
||||
));
|
||||
trim_right_zeroes(result.first);
|
||||
result.second = line_num;
|
||||
|
||||
if (!res) {
|
||||
|
||||
Reference in New Issue
Block a user