summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-24 05:40:34 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-24 05:40:34 +0000
commit76015fc14aa6db744d4c656e42d97283561b2a20 (patch)
tree3b76ad40ba57627cb9bd59a93bd419d5168a7328
parent5ae9301f2bdc31ecf759121218e743e93d386161 (diff)
* lib/tmpdir.rb: setup buffer with nul characters instead of spaces.
fixed [ruby-dev:36493] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@19514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/tmpdir.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5aab3f57ca..41c24aa3db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 24 14:40:21 2008 NAKAMURA Usaku <[email protected]>
+
+ * lib/tmpdir.rb: setup buffer with nul characters instead of spaces.
+ fixed [ruby-dev:36493]
+
Wed Sep 24 14:11:59 2008 Yukihiro Matsumoto <[email protected]>
* lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
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