Skip to content

Commit

Permalink
Escape escape sequences in references-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
jhanssen committed Jan 22, 2016
1 parent 5687de1 commit ce4ebf4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/QueryJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,18 @@ bool QueryJob::write(const String &out, Flags<WriteFlag> flags)
int l = 2;
for (size_t i=0; i<out.size(); ++i) {
const char c = out.at(i);
if (c == '"') {
switch (c) {
case '"':
case '\\':
*(ch + 1) = c;
*ch = '\\';
ch += 2;
l += 2;
} else {
break;
default:
++l;
*ch++ = c;
break;
}
}
o.truncate(l);
Expand Down

0 comments on commit ce4ebf4

Please sign in to comment.