fixed bug that would erase search term made of single wildcard

This commit is contained in:
Jean-Francois Dockes 2012-10-05 09:15:09 +02:00
parent 05f3e48ab3
commit 8de0e2e8c9

View file

@ -211,9 +211,11 @@ inline bool TextSplit::emitterm(bool isspan, string &w, int pos,
// nothing else. We might want to turn this into a test for a // nothing else. We might want to turn this into a test for a
// single utf8 character instead ? // single utf8 character instead ?
if (l == 1) { if (l == 1) {
int c = (int)w[0]; unsigned int c = ((unsigned int)w[0]) & 0xff;
if (charclasses[c] != A_ULETTER && charclasses[c] != A_LLETTER && if (charclasses[c] != A_ULETTER && charclasses[c] != A_LLETTER &&
charclasses[c] != DIGIT) { charclasses[c] != DIGIT &&
(!(m_flags & TXTS_KEEPWILD) || charclasses[c] != WILD)
) {
//cerr << "ERASING single letter term " << c << endl; //cerr << "ERASING single letter term " << c << endl;
return true; return true;
} }