Skip to content

Commit

Permalink
* lib/tmpdir.rb: use return value of getdir.call for length.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
unak committed Sep 28, 2006
1 parent 31fd0d6 commit 406479b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Thu Sep 28 20:49:20 2006 NAKAMURA Usaku <[email protected]>

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

Wed Sep 27 22:08:16 2006 Akinori MUSHA <[email protected]>

* ext/digest/md5/md5init.c (Init_md5): Now that we have digest.rb,
Expand Down
4 changes: 2 additions & 2 deletions lib/tmpdir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 406479b

Please sign in to comment.