--- parser3/src/classes/table.C 2004/02/11 15:33:13 1.196 +++ parser3/src/classes/table.C 2004/04/01 15:08:48 1.201 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_TABLE_C="$Date: 2004/02/11 15:33:13 $"; +static const char * const IDENT_TABLE_C="$Date: 2004/04/01 15:08:48 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -251,7 +251,8 @@ static void skip_empty_and_comment_lines while( char c=*data ) { if( c== '\n' || c == '#' ) { /*nowhere=*/getrow(&data); // remove empty&comment lines - *data_ref=data; + if(!(*data_ref=data)) + break; continue; } break; @@ -335,7 +336,7 @@ static void _load(Request& r, MethodPara Table::element_type row(new ArrayString); skip_empty_and_comment_lines(&data); while( lsplit_result sr=lsplit(&data, separators.column, '\n', separators.encloser) ) { - if(!sr.delim && !row->count()) // append last empty column [if without \n] + if(!*sr.piece && !sr.delim && !row->count()) // append last empty column [if without \n] break; *row+=new String(sr.piece, 0, true); if(sr.delim=='\n') { @@ -629,7 +630,7 @@ static void _hash(Request& r, MethodPara } else throw Exception("parser.runtime", 0, - "value field(s) must be string or self_table" + "value field(s) must be string or table" ); } else { // by all columns, including key if(!(distinct!=D_ILLEGAL && distinct!=D_FIRST)) @@ -644,7 +645,7 @@ static void _hash(Request& r, MethodPara &r, &self_table, /*key_code=*/key_param->get_junction()?key_param:0, - /*key_field=*/0, + /*key_field=*/0/*filled below*/, &value_fields, &result.hash(), distinct,