Skip to content

Commit 0c9f44f

Browse files
mitchellhenkecvvergara
authored andcommitted
Escape backslashes when building tab-separated row
(cherry picked from commit 798d8ec)
1 parent 8a97793 commit 0c9f44f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utilities/utilities.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <string>
2121
#include <vector>
2222

23+
#include "boost/algorithm/string/replace.hpp"
2324

2425

2526
std::string
@@ -39,6 +40,7 @@ tab_separated(const std::vector<std::string> &columns) {
3940
if (column.empty() || column == "") {
4041
result += "\\N\t";
4142
} else {
43+
boost::replace_all(column, "\\", "\\\\");
4244
result += column + "\t";
4345
}
4446
}

0 commit comments

Comments
 (0)