diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-17 22:26:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-17 22:26:58 +0000 |
commit | 2cb2ef977cfec135ae81e251c565b037c6208bc2 (patch) | |
tree | 6a3c9690c48069c8c6019975235fab7fa37ea59a | |
parent | 96bd1643a073c83b17e0e62229e7bdc1a6ba6390 (diff) | |
download | ruby-2cb2ef977cfec135ae81e251c565b037c6208bc2.tar.gz |
* file.c (rb_file_truncate): discard read buffer before truncation.
[ruby-dev:24197]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | file.c | 4 |
2 files changed, 10 insertions, 1 deletions
@@ -1,6 +1,11 @@ +Mon Oct 18 07:26:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * file.c (rb_file_truncate): discard read buffer before truncation. + [ruby-dev:24197] + Mon Oct 18 01:56:03 2004 GOTOU Yuuzou <gotoyuzo@notwork.org> - * 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 <nagai@ai.kyutech.ac.jp> @@ -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); |