--- parser3/src/main/pa_string.C 2003/09/23 13:53:04 1.175.2.2 +++ parser3/src/main/pa_string.C 2003/09/25 09:15:03 1.176 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_STRING_C="$Date: 2003/09/23 13:53:04 $"; +static const char* IDENT_STRING_C="$Date: 2003/09/25 09:15:03 $"; #include "pcre.h" @@ -23,22 +23,22 @@ typedef struct { char target; /* Character we're looking for */ } chr_data; #endif -static int CORD_nnchr_proc(char c, size_t size, void* client_data) +static int CORD_range_contains_chr_greater_then_proc(char c, size_t size, void* client_data) { register chr_data * d = (chr_data *)client_data; if (d -> countdown<=0) return(2); d -> countdown -= size; - if (c != d -> target) return(1); + if (c > d -> target) return(1); return(0); } -int CORD_nnchr(CORD x, size_t i, size_t n, int not_c) +int CORD_range_contains_chr_greater_then(CORD x, size_t i, size_t n, int c) { chr_data d; - d.countdown = i+n; - d.target = not_c; - return(CORD_block_iter(x, i, CORD_nnchr_proc, &d) == 1/*alternatives: 0 normally ended, 2=struck 'n'*/); + d.countdown = n; + d.target = c; + return(CORD_block_iter(x, i, CORD_range_contains_chr_greater_then_proc, &d) == 1/*alternatives: 0 normally ended, 2=struck 'n'*/); } // helpers @@ -54,19 +54,19 @@ public: *this+=new String("match"); *this+=new String("postmatch"); for(int i=0; iLIMIT_VIEW?"...":"", + strlen(body_view), body_view + ); + + return buf; +#undef LIMIT_VIEW +}