mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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/trunk@19513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ba73253e2b
commit
cdc5ebd3f2
2 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue