--- parser3/src/main/pa_string.C 2003/04/21 07:07:45 1.172.2.21.2.41 +++ parser3/src/main/pa_string.C 2003/07/24 11:31:24 1.174 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_STRING_C="$Date: 2003/04/21 07:07:45 $"; +static const char* IDENT_STRING_C="$Date: 2003/07/24 11:31:24 $"; #include "pcre.h" @@ -121,7 +121,7 @@ String::String(const String& src): body( } String& String::append_know_length(const char* str, size_t known_length, Language lang) { - if(!known_length || !*str) + if(!known_length) return *this; body.append_know_length(str, known_length); @@ -233,7 +233,7 @@ void String::split(ArrayString& result, if(size_t delim_length=strlen(delim)) { int pos_before; // while we have 'delim'... - for(; (pos_before=pos(delim, pos_after, lang))>=0 && limit; limit--) { + for(; (pos_before=pos(delim, pos_after, lang))!=STRING_NOT_FOUND && limit; limit--) { result+=&mid(pos_after, pos_before); pos_after=pos_before+delim_length; } @@ -255,7 +255,7 @@ void String::split(ArrayString& result, if(!delim.is_empty()) { int pos_before; // while we have 'delim'... - for(; (pos_before=pos(delim, pos_after, lang))>=0 && limit; limit--) { + for(; (pos_before=pos(delim, pos_after, lang))!=STRING_NOT_FOUND && limit; limit--) { result+=&mid(pos_after, pos_before); pos_after=pos_before+delim.length(); } @@ -291,8 +291,8 @@ static void regex_options(const String* if(options && !options->is_empty()) for(Regex_option *o=regex_option; o->keyL; o++) - if(options->pos(o->keyL)>=0 - || (o->keyU && options->pos(o->keyU)>=0)) { + if(options->pos(o->keyL)!=STRING_NOT_FOUND + || (o->keyU && options->pos(o->keyU)!=STRING_NOT_FOUND)) { if(o->flag) *o->flag=true; else { // result