1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/tmpdir.rb: use return value of getdir.call for length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2006-09-28 11:54:37 +00:00
parent 31fd0d6029
commit 406479b3b5
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Thu Sep 28 20:49:20 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/tmpdir.rb: use return value of getdir.call for length.
Wed Sep 27 22:08:16 2006 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/md5/md5init.c (Init_md5): Now that we have digest.rb,

View file

@ -17,8 +17,8 @@ class Dir
rescue RuntimeError
getdir = Win32API.new('kernel32', 'GetWindowsDirectory', 'PL', 'L')
end
getdir.call(windir, windir.size)
windir = File.expand_path(windir.rstrip.untaint)
len = getdir.call(windir, windir.size)
windir = File.expand_path(windir[0, len])
temp = File.join(windir, 'temp')
@@systmpdir = temp if File.directory?(temp) and File.writable?(temp)
rescue LoadError