summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/tmpdir.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7832ce273f..e099c49132 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 24 14:38:29 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/tmpdir.rb: setup buffer with nul characters instead of spaces.
+ fixed [ruby-dev:36493]
+
Wed Sep 24 11:18:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_s_binread): offset argument was wrongly passed to
diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb
index 2e82aa528e..bcd66ab424 100644
--- a/lib/tmpdir.rb
+++ b/lib/tmpdir.rb
@@ -14,7 +14,7 @@ class Dir
require 'Win32API'
CSIDL_LOCAL_APPDATA = 0x001c
max_pathlen = 260
- windir = ' '*(max_pathlen+1)
+ windir = "\0"*(max_pathlen+1)
begin
getdir = Win32API.new('shell32', 'SHGetFolderPath', 'LLLLP', 'L')
raise RuntimeError if getdir.call(0, CSIDL_LOCAL_APPDATA, 0, 0, windir) != 0