--- parser3/src/main/pa_string.C 2001/04/03 15:35:24 1.66 +++ parser3/src/main/pa_string.C 2001/04/03 17:01:03 1.68 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_string.C,v 1.66 2001/04/03 15:35:24 paf Exp $ + $Id: pa_string.C,v 1.68 2001/04/03 17:01:03 paf Exp $ */ #include "pa_config_includes.h" @@ -505,7 +505,7 @@ bool String::match(const String *aorigin tables=pcre_maketables(); } } - const char *pattern=regexp.cstr(); + const char *pattern=regexp.cstr(UL_AS_IS); const char *errptr; int erroffset; int option_bits[2]; regex_options(options?options->cstr():0, option_bits); @@ -513,11 +513,10 @@ bool String::match(const String *aorigin &errptr, &erroffset, tables); - if(!code) { + if(!code) THROW(0, 0, ®exp.piece(erroffset, regexp.size()), - errptr); - } + "match error - %s", errptr); int info_substrings=pcre_info(code, 0, 0); if(info_substrings<0) { @@ -529,7 +528,7 @@ bool String::match(const String *aorigin } int startoffset=0; - const char *subject=cstr(); + const char *subject=cstr(UL_AS_IS); int length=strlen(subject); int ovecsize; int *ovector=(int *)malloc(sizeof(int)* @@ -556,7 +555,7 @@ bool String::match(const String *aorigin if(exec_substrings==PCRE_ERROR_NOMATCH) { (*pcre_free)(code); - (*row_action)(**table, 0/*last time, no row*/, info); + (*row_action)(**table, 0/*last time, no row*/, 0, 0, info); return option_bits[1]!=0; // global=true+table, not global=false } @@ -578,15 +577,14 @@ bool String::match(const String *aorigin row+=&piece(ovector[i*2+0], ovector[i*2+1]); // .i column value } - (*row_action)(**table, &row, info); + (*row_action)(**table, &row, startoffset, ovector[0], info); - if(!option_bits[1]) { // not global + if(!option_bits[1] || !(startoffset=ovector[1])) { // not global | going to hang (*pcre_free)(code); - (*row_action)(**table, 0/*last time, no row*/, info); + (*row_action)(**table, 0/*last time, no row*/, 0, 0, info); return true; } - startoffset=ovector[1]; /* if(option_bits[0] & PCRE_MULTILINE) exec_option_bits|=PCRE_NOTBOL; // start of subject+startoffset not BOL