Project

General

Profile

Bug #1263 ยป tmpdir.patch

cfis (Charlie Savage), 03/11/2009 06:41 AM

View differences:

lib/tmpdir.rb (working copy)
max_pathlen = 260
windir = "\0"*(max_pathlen+1)
begin
getdir = Win32API.new('shell32', 'SHGetFolderPath', 'LLLLP', 'L')
getdir = Win32API.new('shell32', 'SHGetFolderPath', 'LLLLP', 'L', :stdcall)
raise RuntimeError if getdir.call(0, CSIDL_LOCAL_APPDATA, 0, 0, windir) != 0
windir.rstrip!
rescue RuntimeError
    (1-1/1)