Rework fixHebArticle() a bit.

This commit is contained in:
Konstantin Isakov 2011-06-07 19:48:05 -07:00
parent 2c6eb72148
commit e87dce57ad

15
bgl.cc
View file

@ -576,12 +576,15 @@ void BglArticleRequest::fixHebString(string & hebStr) // Hebrew support - conver
void BglArticleRequest::fixHebArticle(string & hebArticle) // Hebrew support - remove extra chars at the end
{
int nulls=hebArticle.size()-1;
while ( nulls>=0 && ((hebArticle[nulls]<=32 && hebArticle[nulls]>=0) || (hebArticle[nulls]>=65 && hebArticle[nulls]<=90))) //special chars and A-Z
{
nulls--;
}
hebArticle.erase (hebArticle.begin()+nulls+1, hebArticle.end());
unsigned nulls;
for ( nulls = hebArticle.size(); nulls > 0 &&
( ( hebArticle[ nulls - 1 ] <= 32 &&
hebArticle[ nulls - 1 ] >= 0 ) ||
( hebArticle[ nulls - 1 ] >= 65 &&
hebArticle[ nulls - 1 ] <= 90 ) ); --nulls ) ; //special chars and A-Z
hebArticle.resize( nulls );
}
void BglArticleRequest::run()