diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-08 13:14:51 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-08 13:14:51 +0000 |
commit | 78af046e8635b3176299994170f8004a14c78c52 (patch) | |
tree | 59e996363534d8072d5b9409e71f6f9e1e931d45 /win32 | |
parent | 1da20f3efbe510c2c143dd5971f70b77590dbc31 (diff) |
merge revision(s) 27667:
* ext/etc/etc.c (etc_systmpdir): moved from ext/tmpdir.
* ext/etc/etc.c (etc_sysconfdir): added.
* lib/rubygems/config_file.rb, lib/tmpdir.rb: use etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c index 7f46622dd5..c3bd4dcf55 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -68,6 +68,7 @@ static int has_redirection(const char *); int rb_w32_wait_events(HANDLE *events, int num, DWORD timeout); static int rb_w32_open_osfhandle(intptr_t osfhandle, int flags); static int wstati64(const WCHAR *path, struct stati64 *st); +VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc); #define RUBY_CRITICAL(expr) do { expr; } while (0) @@ -466,6 +467,16 @@ get_system_directory(WCHAR *path, UINT len) #define numberof(array) (sizeof(array) / sizeof(*array)) +VALUE +rb_w32_special_folder(int type) +{ + WCHAR path[_MAX_PATH]; + + if (!get_special_folder(type, path)) return Qnil; + regulate_path(path); + return rb_w32_conv_from_wchar(path, rb_filesystem_encoding()); +} + UINT rb_w32_system_tmpdir(WCHAR *path, UINT len) { |