--- parser3/src/main/pa_string.C 2001/07/18 10:06:04 1.94 +++ parser3/src/main/pa_string.C 2001/07/24 15:43:56 1.96 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: pa_string.C,v 1.94 2001/07/18 10:06:04 parser Exp $"; +static const char *RCSId="$Id: pa_string.C,v 1.96 2001/07/24 15:43:56 parser Exp $"; #include "pa_config_includes.h" @@ -329,10 +329,10 @@ int String::cmp(int& partial, const char #ifndef NO_STRING_ORIGIN const Origin& String::origin() const { - if(!fused_rows) - THROW(0, 0, - 0, - "String::origin() of empty string called"); + if(!fused_rows) { + static const Origin empty_origin={"empty string"}; + return empty_origin; + } // determining origin by last appended piece // because first one frequently constant. @@ -493,7 +493,8 @@ bool String::match(const unsigned char * const String& regexp, const String *options, Table **table, - Row_action row_action, void *info) const { + Row_action row_action, void *info, + bool *was_global) const { if(!regexp.size()) THROW(0, 0, @@ -503,6 +504,8 @@ bool String::match(const unsigned char * const char *errptr; int erroffset; int option_bits[2]; regex_options(options?options->cstr():0, option_bits); + if(was_global) + *was_global=option_bits[1]!=0; pcre *code=pcre_compile(pattern, option_bits[0], &errptr, &erroffset, pcre_tables);