From a4a05aa812a4edd8536001b9bd0e15f2d09cc15e Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Wed, 30 Sep 2009 22:24:11 +0200 Subject: [PATCH] fix Trim() as it seems it doesn't work in some cases --- src/conv.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conv.cpp b/src/conv.cpp index a5996386..93a412fb 100644 --- a/src/conv.cpp +++ b/src/conv.cpp @@ -234,11 +234,11 @@ void Trim(std::string &s) size_t b = 0; size_t e = s.length()-1; - while (!isprint(s[b])) - b++; - while (!isprint(s[e])) - e--; - e++; + while (s[b] == ' ' || s[b] == '\n') + ++b; + while (s[e] == ' ' || s[e] == '\n') + --e; + ++e; if (b != 0 || e != s.length()-1) s = s.substr(b, e-b);