--- parser3/src/main/pa_uue.C 2003/01/21 15:51:15 1.4 +++ parser3/src/main/pa_uue.C 2007/10/22 14:34:24 1.11 @@ -1,18 +1,20 @@ /** @file Parser: uuencoding impl. - Copyright(c) 2000,2001, 2003 ArtLebedev Group(http://www.artlebedev.com) + Copyright(c) 2000,2001-2005 ArtLebedev Group(http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) @todo setrlimit */ -static const char* IDENT_UUE_C="$Date: 2003/01/21 15:51:15 $"; +static const char * const IDENT_UUE_C="$Date: 2007/10/22 14:34:24 $"; #include "pa_config_includes.h" #include "pa_uue.h" +#define UUE_MAX_STRING 0x40 + static unsigned char uue_table[64] = { '`', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', @@ -23,10 +25,9 @@ static unsigned char uue_table[64] = { 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\',']', '^', '_' }; -void pa_uuencode(String& result, const char *file_name_cstr, const VFile& vfile) { +void pa_uuencode(String& result, const String& file_name, const VFile& vfile) { //header - result << "content-transfer-encoding: x-uuencode\n" << "\n"; - result << "begin 644 " << file_name_cstr << "\n"; + result << "begin 644 " << file_name << "\n"; //body const unsigned char *in=(const unsigned char *)vfile.value_ptr(); @@ -39,7 +40,7 @@ void pa_uuencode(String& result, const c if((itemp+count)>(in+in_length)) count=in_length-(itemp-in); - char *buf=(char *)result.pool().malloc(MAX_STRING); + char *buf=new(PointerFreeGC) char[UUE_MAX_STRING]; char *optr=buf; /* @@ -81,6 +82,6 @@ void pa_uuencode(String& result, const c } //footer - result.APPEND_AS_IS((const char *)uue_table, 1/* one char */, 0, 0) << "\n" + result<< "`\n" "end\n"; }