aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/storages/parserse_base_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/include/storages/parserse_base_utils.h')
-rw-r--r--contrib/epee/include/storages/parserse_base_utils.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/epee/include/storages/parserse_base_utils.h b/contrib/epee/include/storages/parserse_base_utils.h
index 31495ae13..d73fbde3a 100644
--- a/contrib/epee/include/storages/parserse_base_utils.h
+++ b/contrib/epee/include/storages/parserse_base_utils.h
@@ -91,11 +91,15 @@ namespace misc_utils
*/
inline void match_string2(std::string::const_iterator& star_end_string, std::string::const_iterator buf_end, std::string& val)
{
- val.clear();
- val.reserve(std::distance(star_end_string, buf_end));
bool escape_mode = false;
std::string::const_iterator it = star_end_string;
++it;
+ std::string::const_iterator fi = it;
+ while (fi != buf_end && *fi != '\\' && *fi != '\"')
+ ++fi;
+ val.assign(it, fi);
+ val.reserve(std::distance(star_end_string, buf_end));
+ it = fi;
for(;it != buf_end;it++)
{
if(escape_mode/*prev_ch == '\\'*/)