Module: check_mk
Branch: master
Commit: e363eec18af8827c36b4b177c25f75b4896cbb5c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e363eec18af882…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Jun 14 16:58:53 2016 +0200
fixed broken escaping of " and \ in livestatus results
---
livestatus/src/Query.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc
index c5fc65c..63cc145 100644
--- a/livestatus/src/Query.cc
+++ b/livestatus/src/Query.cc
@@ -1088,7 +1088,10 @@ void Query::outputString(const char *value, int len) {
// Output ASCII characters unencoded
else if (*r >= 32 || len >= 0) {
- add((*r == '"' || *r == '\\') ? "\\" :
string(r, 1));
+ if (*r == '"' || *r == '\\') {
+ add("\\");
+ }
+ add(string(r, 1));
}
// interprete two-Byte UTF-8 sequences in mode 'utf8' and
'mixed'