summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--lib/tmpdir.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 30168505f3..da6424f6f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Sep 28 20:53:16 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/tmpdir.rb: use return value of getdir.call for length.
+
Wed Sep 27 01:04:49 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (try_func): check function pointer first and macro next.
diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb
index 3042ed5202..434d1bf053 100644
--- a/lib/tmpdir.rb
+++ b/lib/tmpdir.rb
@@ -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