From 753cde6773d7a9da86c95386f739510003c8f153 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 27 Jan 2019 10:00:02 +0100 Subject: [PATCH] fixed escaping with quote or dquote (fixes #256) --- src/ebusd/mainloop.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ebusd/mainloop.cpp b/src/ebusd/mainloop.cpp index 927e16cc..e3459b76 100755 --- a/src/ebusd/mainloop.cpp +++ b/src/ebusd/mainloop.cpp @@ -476,11 +476,11 @@ result_t MainLoop::decodeMessage(const string &data, bool isHttp, bool* connecte } else if (token.length() == 0) { // allow multiple space chars for a single delimiter continue; } else if (token[0] == '"' || token[0] == '\'') { + escaped = token[0]; token.erase(0, 1); - if (token.length() > 0 && token[token.length()-1] == token[0]) { + if (token.length() > 0 && token[token.length()-1] == escaped) { token.erase(token.length() - 1, 1); - } else { - escaped = token[0]; + escaped = 0; } } }