summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog21
-rw-r--r--file.c4
2 files changed, 17 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 052acf12a2..33ebf34a32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,31 +1,36 @@
+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 02:11:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
+
* lib/webrick/config.rb (WEBrick::Config::General): add default values:
- WEBrick::Config[:DoNotReverseLookup]
- WEBrick::Config[:RequestCallback] (it used as an alias of
:RequestHandler in WEBrick::HTTPServer#run)
- WEBrick::Config::FileHandler[:AcceptableLanguages]
-
+
* lib/webrick/httpservlet/filehandler.rb
(WEBrick::HTTPServlet::FileHandler#set_filename): search files
having suffix of language-name which Accept-Language header field
includes if :AcceptableLanguages options is present.
-
+
* lib/webrick/httpservlet/filehandler.rb
(WEBrick::HTTPServlet::FileHandler#get_servlet): new method to
search servlet correspond to the suffix of filename.
-
+
* lib/webrick/httprequest.rb: add attributes access methods: accept,
accept_charset, accept_encoding, accept_language, content_length
and content_type.
-
+
* lib/webrick/httpresponse.rb: add attribute access methods:
content_length, content_length=, content_type and content_type=.
-
+
* lib/webrick/httputils.rb (WEBrick::HTTPUtils.mime_types):
use the second suffix to detect media type. (the first suffix
may be a language name.)
-
+
* lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_qvalues):
add method to parse Accept header field. it returns an Array of
values sorted by the qvalues.
@@ -70,7 +75,7 @@ Sat Oct 16 13:34:56 2004 Kouhei Sutou <kou@cozmixng.org>
Fri Oct 15 18:04:35 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/timer.rb: TkTimer.new(interval, loop){ ... } is
- acceptable. Add TkTimer.start ( == new + start ).
+ acceptable. Add TkTimer.start ( == new + start ).
Fri Oct 15 12:43:09 2004 Tanaka Akira <akr@m17n.org>
diff --git a/file.c b/file.c
index ffa70c6093..d656b705c1 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;
@@ -2861,6 +2864,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);