Trim null characters on Windows (fixes #78)

This commit is contained in:
Antony Polukhin
2019-06-29 10:44:27 +03:00
parent 2d810e294f
commit 36734b1531

View File

@@ -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) {