consider cr and lf as whitespace when splitting strings

This commit is contained in:
dockes 2007-10-19 15:25:19 +00:00
parent 5954576221
commit e8d8e58d40
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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<string> &tokens)
case ' ':
case '\t':
case '\n':
case '\r':
switch(state) {
case SPACE:
continue;