diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/dir.h | 3 | ||||
-rw-r--r-- | win32/file.c | 2 | ||||
-rw-r--r-- | win32/win32.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/win32/dir.h b/win32/dir.h index a0759804f6..28fbb6cf2e 100644 --- a/win32/dir.h +++ b/win32/dir.h @@ -38,11 +38,12 @@ void rb_w32_rewinddir(DIR *); void rb_w32_closedir(DIR *); char *rb_w32_ugetcwd(char *, int); -#define opendir(s) rb_w32_opendir((s)) +#define opendir(s) rb_w32_uopendir((s)) #define readdir(d) rb_w32_readdir((d), 0) #define telldir(d) rb_w32_telldir((d)) #define seekdir(d, l) rb_w32_seekdir((d), (l)) #define rewinddir(d) rb_w32_rewinddir((d)) #define closedir(d) rb_w32_closedir((d)) +#define getcwd(b, s) rb_w32_ugetcwd(b, s) #endif /* RUBY_WIN32_DIR_H */ diff --git a/win32/file.c b/win32/file.c index 71320242e2..5c34bd42b4 100644 --- a/win32/file.c +++ b/win32/file.c @@ -347,7 +347,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na if (path_cp == INVALID_CODE_PAGE || rb_enc_str_asciionly_p(path)) { /* use filesystem encoding if expanding home dir */ path_encoding = rb_filesystem_encoding(); - cp = path_cp = system_code_page(); + cp = path_cp = code_page(path_encoding); } /* ignores dir since we are expanding home */ diff --git a/win32/win32.c b/win32/win32.c index 59040824ad..4f0c0d29c1 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2270,7 +2270,7 @@ rb_w32_conv_from_wstr(const WCHAR *wstr, long *lenp, rb_encoding *enc) long len; char *ptr; - if (NIL_P(str)) return wstr_to_filecp(wstr, lenp); + if (NIL_P(str)) return wstr_to_utf8(wstr, lenp); *lenp = len = RSTRING_LEN(str); memcpy(ptr = malloc(len + 1), RSTRING_PTR(str), len); ptr[len] = '\0'; |