From e8d8e58d4074b7576e6646d6e07b9a31409119bb Mon Sep 17 00:00:00 2001 From: dockes Date: Fri, 19 Oct 2007 15:25:19 +0000 Subject: [PATCH] consider cr and lf as whitespace when splitting strings --- src/qtgui/ssearch_w.cpp | 4 ++-- src/utils/smallut.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qtgui/ssearch_w.cpp b/src/qtgui/ssearch_w.cpp index 1b24b3d0..0fad8a29 100644 --- a/src/qtgui/ssearch_w.cpp +++ b/src/qtgui/ssearch_w.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.23 2007-10-05 08:03:01 dockes Exp $ (C) 2006 J.F.Dockes"; +static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.24 2007-10-19 15:25:19 dockes Exp $ (C) 2006 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -107,7 +107,7 @@ void SSearch::startSimpleSearch() // If there is no white space inside the query, then the user // certainly means it as a phrase. bool isreallyaphrase = false; - if (u8.find_first_of(" \t") == string::npos) + if (u8.find_first_of(" \t\r\n") == string::npos) isreallyaphrase = true; // Maybe add automatic phrase ? For ALL and ANY, and not if diff --git a/src/utils/smallut.cpp b/src/utils/smallut.cpp index 2965c88d..c84b58ae 100644 --- a/src/utils/smallut.cpp +++ b/src/utils/smallut.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: smallut.cpp,v 1.26 2007-02-08 17:05:12 dockes Exp $ (C) 2004 J.F.Dockes"; +static char rcsid[] = "@(#$Id: smallut.cpp,v 1.27 2007-10-19 15:25:19 dockes Exp $ (C) 2004 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -215,6 +215,7 @@ bool stringToStrings(const string &s, std::list &tokens) case ' ': case '\t': case '\n': + case '\r': switch(state) { case SPACE: continue;