--- parser3/src/main/untaint.C 2003/11/20 17:15:12 1.124 +++ parser3/src/main/untaint.C 2004/01/22 08:28:55 1.126 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_UNTAINT_C="$Date: 2003/11/20 17:15:12 $"; +static const char * const IDENT_UNTAINT_C="$Date: 2004/01/22 08:28:55 $"; #include "pa_string.h" @@ -72,8 +72,8 @@ extern "C" { // author forgot to do that CORD_ec_append(info->result, hex[((unsigned char)c)%0x10]); \ } else \ CORD_ec_append(info->result, otherwise); -#define to_char(c) CORD_ec_append(info->result, c) -#define to_string(s) CORD_ec_append_cord(info->result, s) +#define to_char(c) { CORD_ec_append(info->result, c); whitespace=false; } +#define to_string(s) { CORD_ec_append_cord(info->result, s); whitespace=false; } inline bool need_file_encode(unsigned char c){ // russian letters and space ENABLED @@ -258,6 +258,7 @@ inline bool addr_spec_soon(const char *s inline bool mail_header_nonspace_char(char c) { return c != 0x20; } + inline void ec_append(CORD_ec& result, bool& optimize, bool& whitespace, CORD_pos pos, size_t size) { while(size--) { CORD_ec_append(result, CORD_pos_fetch(pos)); @@ -266,12 +267,12 @@ inline void ec_append(CORD_ec& result, b } inline void pa_CORD_pos_advance(CORD_pos pos, size_t n) { while(true) { - size_t avail=CORD_pos_chars_left(pos); - if(avail==0) { + long avail=CORD_pos_chars_left(pos); + if(avail<=0) { CORD_next(pos); if(!--n) break; - } else if(avail=n