--- parser3/src/classes/table.C 2005/11/25 09:52:07 1.217 +++ parser3/src/classes/table.C 2006/01/20 11:28:44 1.220 @@ -4,7 +4,7 @@ Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_TABLE_C="$Date: 2005/11/25 09:52:07 $"; +static const char * const IDENT_TABLE_C="$Date: 2006/01/20 11:28:44 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -331,9 +331,10 @@ static void _load(Request& r, MethodPara } Table& table=*new Table(columns); + int columns_count=columns? columns->count(): 0; // parse cells - Table::element_type row(new ArrayString); + Table::element_type row(new ArrayString(columns_count)); skip_empty_and_comment_lines(&data); while( lsplit_result sr=lsplit(&data, separators.column, '\n', separators.encloser) ) { if(!*sr.piece && !sr.delim && !row->count()) // append last empty column [if without \n] @@ -341,7 +342,7 @@ static void _load(Request& r, MethodPara *row+=new String(sr.piece, 0, true); if(sr.delim=='\n') { table+=row; - row=new ArrayString; + row=new ArrayString(columns_count); skip_empty_and_comment_lines(&data); } } @@ -358,9 +359,10 @@ static void maybe_enclose( String& to, c to<<*sencloser; // while we have 'encloser'... size_t pos_after=0; - for( size_t pos_before; (pos_before=from.pos( encloser, pos_after ))!=STRING_NOT_FOUND; pos_after=pos_before+1) { - to<