--- parser3/src/main/pa_string.C 2001/04/05 13:27:14 1.71 +++ parser3/src/main/pa_string.C 2001/04/05 19:35:16 1.73 @@ -5,13 +5,11 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_string.C,v 1.71 2001/04/05 13:27:14 paf Exp $ + $Id: pa_string.C,v 1.73 2001/04/05 19:35:16 paf Exp $ */ #include "pa_config_includes.h" -#include - #include "pcre.h" #include "pa_pool.h" @@ -491,7 +489,6 @@ static void regex_options(char *options, @verbatim pre-match/match/post-match/1/2/3/... @endverbatim - @test setlocale param to auto.p */ bool String::match(const String *aorigin, const String& regexp, @@ -500,11 +497,15 @@ bool String::match(const String *aorigin Row_action row_action, void *info) const { static const unsigned char *tables=0; { SYNCHRONIZED(true); - if(!tables) { - setlocale(LC_CTYPE, "ru"); + if(!tables) tables=pcre_maketables(); - } } + + + if(!regexp.size()) + THROW(0, 0, + aorigin, + "regexp is empty"); const char *pattern=regexp.cstr(UL_AS_IS); const char *errptr; int erroffset; @@ -522,9 +523,9 @@ bool String::match(const String *aorigin if(info_substrings<0) { (*pcre_free)(code); THROW(0, 0, - aorigin, - "pcre_info error #%d", - info_substrings); + aorigin, + "pcre_info error #%d", + info_substrings); } int startoffset=0;