We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 126caad commit 1760607Copy full SHA for 1760607
abstract-filter.cc
@@ -26,6 +26,7 @@
26
#include <sstream>
27
#include <vector>
28
29
+#include <boost/algorithm/string/replace.hpp>
30
#include <boost/foreach.hpp>
31
32
// /////////////////////////////////////////////////////////////////////////////
@@ -136,6 +137,11 @@ void appendCtxLines(
136
137
// skip lines before the context lines
138
continue;
139
140
+ // quote embedded NULs as they cause problems to some JSON parsers
141
+ std::string nul;
142
+ nul.push_back('\0');
143
+ boost::algorithm::replace_all(text, nul, "[NUL]");
144
+
145
// format a single line of the comment
146
std::ostringstream str;
147
str << std::fixed << std::setw(5) << line;
0 commit comments