From 0078ce7fac6a205341fee659b7f5adefa7f0b7aa Mon Sep 17 00:00:00 2001 From: xiphon Date: Wed, 12 Feb 2020 20:53:29 +0000 Subject: wipeable_string: split - treat CR, LF and Tabs as separators --- contrib/epee/src/wipeable_string.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'contrib') diff --git a/contrib/epee/src/wipeable_string.cpp b/contrib/epee/src/wipeable_string.cpp index 4209b71bf..4928db172 100644 --- a/contrib/epee/src/wipeable_string.cpp +++ b/contrib/epee/src/wipeable_string.cpp @@ -188,13 +188,14 @@ void wipeable_string::split(std::vector &fields) const while (len--) { const char c = *ptr++; - if (c != ' ') + const bool space_prev = space; + space = std::isspace(c); + if (!space) { - if (space) + if (space_prev) fields.push_back({}); fields.back().push_back(c); } - space = c == ' '; } } -- cgit v1.2.3