--- parser3/src/main/pa_common.C 2001/10/31 14:01:45 1.80 +++ parser3/src/main/pa_common.C 2001/10/31 16:19:58 1.83 @@ -4,7 +4,7 @@ Copyright(c) 2001 ArtLebedev Group(http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_common.C,v 1.80 2001/10/31 14:01:45 paf Exp $ + $Id: pa_common.C,v 1.83 2001/10/31 16:19:58 paf Exp $ */ #include "pa_common.h" @@ -16,15 +16,12 @@ #include "pa_hash.h" #include "pa_string.h" -#ifdef WIN32 -# ifndef _O_TEXT -# define _O_TEXT 0 -# endif -# ifndef _O_BINARY -# define _O_BINARY 0 -# endif +#ifndef _O_TEXT +# define _O_TEXT 0 +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 #endif - #ifndef O_TRUNC # define O_TRUNC 0 #endif @@ -97,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);