--- parser3/src/main/pa_common.C 2001/10/31 15:05:00 1.82 +++ parser3/src/main/pa_common.C 2001/11/05 11:46:27 1.85 @@ -2,9 +2,9 @@ Parser: commonly functions. Copyright(c) 2001 ArtLebedev Group(http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Author: Alexander Petrosyan (http://paf.design.ru) - $Id: pa_common.C,v 1.82 2001/10/31 15:05:00 paf Exp $ + $Id: pa_common.C,v 1.85 2001/11/05 11:46:27 paf Exp $ */ #include "pa_common.h" @@ -94,7 +94,11 @@ bool file_read(Pool& pool, const String& flock(f, LOCK_EX);*/ size_t max_size=limit?min(offset+limit, finfo.st_size)-offset:finfo.st_size; if(!max_size) { // eof - data=0; + if(as_text) { + data=pool.malloc(1); + *(char*)data=0; + } else + data=0; read_size=0; } else { data=pool.malloc(max_size+(as_text?1:0), 3); @@ -438,7 +442,7 @@ bool StrEqNc(const char *s1, const char } } -static int isLeap(int year) { +static bool isLeap(int year) { return !( (year % 4) || ((year % 400) && !(year % 100)) );