From 82a8894d75daab83589cd9cc05a3f3ced9ccb9fc Mon Sep 17 00:00:00 2001 From: lyg1949 Date: Wed, 24 Jan 2024 10:21:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dkv=E5=80=BC=E5=88=87=E5=89=B2?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果string为`url=http://127.0.0.1?token=12345&name=test` 方法`splitKV(string, ',', '=')`的分割结果不正确: `url=test` --- cpputil/hstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpputil/hstring.cpp b/cpputil/hstring.cpp index d845b36e1..33da2671c 100644 --- a/cpputil/hstring.cpp +++ b/cpputil/hstring.cpp @@ -131,7 +131,7 @@ hv::KeyValue splitKV(const std::string& str, char kv_kv, char k_v) { state = s_key; key = p+1; } - else if (*p == k_v) { + else if (*p == k_v && state != s_value) { state = s_value; value = p+1; }