diff --git a/ChangeLog b/ChangeLog index b28382ae2d..b447a68298 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ +Mon Oct 18 07:26:21 2004 Nobuyoshi Nakada + + * file.c (rb_file_truncate): discard read buffer before truncation. + [ruby-dev:24197] + Mon Oct 18 01:56:03 2004 GOTOU Yuuzou - * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#initialize): + * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#initialize): initial value of accpet-* should be array. Sun Oct 17 23:03:48 2004 Hidetoshi NAGAI diff --git a/file.c b/file.c index 36cb34a8cc..69f600e115 100644 --- a/file.c +++ b/file.c @@ -67,6 +67,9 @@ char *strrchr _((const char*,const char)); #ifndef HAVE_LSTAT #define lstat(path,st) stat(path,st) #endif +#if !HAVE_FSEEKO && !defined(fseeko) +# define fseeko fseek +#endif VALUE rb_cFile; VALUE rb_mFileTest; @@ -2973,6 +2976,7 @@ rb_file_truncate(obj, len) } f = GetWriteFile(fptr); fflush(f); + fseeko(f, (off_t)0, SEEK_CUR); #ifdef HAVE_TRUNCATE if (ftruncate(fileno(f), NUM2OFFT(len)) < 0) rb_sys_fail(fptr->path);