win32.c: w32_stati64
* win32/win32.c (w32_stati64): extract codepage aware code from rb_w32_ustati64() and rb_w32_stati64(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1f500f0368
commit
cc3ec30ac9
@ -1,4 +1,7 @@
|
|||||||
Sun Jun 30 10:58:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Jun 30 10:58:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.c (w32_stati64): extract codepage aware code from
|
||||||
|
rb_w32_ustati64() and rb_w32_stati64().
|
||||||
|
|
||||||
* dln.h (DLN_FIND_EXTRA_ARG, DLN_FIND_EXTRA_ARG_DECL): allow extra
|
* dln.h (DLN_FIND_EXTRA_ARG, DLN_FIND_EXTRA_ARG_DECL): allow extra
|
||||||
arguments to dln_find_{exe,file}_r().
|
arguments to dln_find_{exe,file}_r().
|
||||||
|
@ -49,6 +49,8 @@
|
|||||||
#include "win32/dir.h"
|
#include "win32/dir.h"
|
||||||
#define isdirsep(x) ((x) == '/' || (x) == '\\')
|
#define isdirsep(x) ((x) == '/' || (x) == '\\')
|
||||||
|
|
||||||
|
static int w32_stati64(const char *path, struct stati64 *st, UINT cp);
|
||||||
|
|
||||||
#undef stat
|
#undef stat
|
||||||
#undef fclose
|
#undef fclose
|
||||||
#undef close
|
#undef close
|
||||||
@ -4892,24 +4894,24 @@ wstati64(const WCHAR *path, struct stati64 *st)
|
|||||||
int
|
int
|
||||||
rb_w32_ustati64(const char *path, struct stati64 *st)
|
rb_w32_ustati64(const char *path, struct stati64 *st)
|
||||||
{
|
{
|
||||||
WCHAR *wpath;
|
return w32_stati64(path, st, CP_UTF8);
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!(wpath = utf8_to_wstr(path, NULL)))
|
|
||||||
return -1;
|
|
||||||
ret = wstati64(wpath, st);
|
|
||||||
free(wpath);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* License: Ruby's */
|
/* License: Ruby's */
|
||||||
int
|
int
|
||||||
rb_w32_stati64(const char *path, struct stati64 *st)
|
rb_w32_stati64(const char *path, struct stati64 *st)
|
||||||
|
{
|
||||||
|
return w32_stati64(path, st, filecp());
|
||||||
|
}
|
||||||
|
|
||||||
|
/* License: Ruby's */
|
||||||
|
static int
|
||||||
|
w32_stati64(const char *path, struct stati64 *st, UINT cp)
|
||||||
{
|
{
|
||||||
WCHAR *wpath;
|
WCHAR *wpath;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!(wpath = filecp_to_wstr(path, NULL)))
|
if (!(wpath = mbstr_to_wstr(cp, path, -1, NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
ret = wstati64(wpath, st);
|
ret = wstati64(wpath, st);
|
||||||
free(wpath);
|
free(wpath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user