From c2bf2928d0e9bb96e177e098c1c8e6b207512cca Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Fri, 3 Sep 2021 18:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84key-value=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Parser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Common/Parser.cpp b/src/Common/Parser.cpp index 5a86caf7..1a41bbc4 100644 --- a/src/Common/Parser.cpp +++ b/src/Common/Parser.cpp @@ -148,7 +148,10 @@ StrCaseMap Parser::parseArgs(const string &str, const char *pair_delim, const ch auto val = trim(FindField(key_val.data(), key_delim, NULL)); ret.emplace_force(key, val); } else { - ret.emplace_force(key_val, ""); + trim(key_val); + if (!key_val.empty()) { + ret.emplace_force(key_val, ""); + } } } return ret;