diff options
-rw-r--r-- | Include/fileutils.h | 4 | ||||
-rw-r--r-- | Modules/getpath.c | 17 | ||||
-rw-r--r-- | Python/fileutils.c | 17 |
3 files changed, 17 insertions, 21 deletions
diff --git a/Include/fileutils.h b/Include/fileutils.h index 577ad88..93a9297 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -15,10 +15,6 @@ PyAPI_FUNC(char*) Py_EncodeLocale( const wchar_t *text, size_t *error_pos); -PyAPI_FUNC(int) _Py_wstat( - const wchar_t* path, - struct stat *buf); - #ifndef Py_LIMITED_API #ifdef MS_WINDOWS diff --git a/Modules/getpath.c b/Modules/getpath.c index 3564d72..429bef3 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -131,6 +131,23 @@ static wchar_t exec_prefix[MAXPATHLEN+1]; static wchar_t progpath[MAXPATHLEN+1]; static wchar_t *module_search_path = NULL; +/* Get file status. Encode the path to the locale encoding. */ + +static int +_Py_wstat(const wchar_t* path, struct stat *buf) +{ + int err; + char *fname; + fname = Py_EncodeLocale(path, NULL); + if (fname == NULL) { + errno = EINVAL; + return -1; + } + err = stat(fname, buf); + PyMem_Free(fname); + return err; +} + static void reduce(wchar_t *dir) { diff --git a/Python/fileutils.c b/Python/fileutils.c index 63c2571..e6d3154 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -520,23 +520,6 @@ Py_EncodeLocale(const wchar_t *text, size_t *error_pos) } -/* Get file status. Encode the path to the locale encoding. */ -int -_Py_wstat(const wchar_t* path, struct stat *buf) -{ - int err; - char *fname; - fname = Py_EncodeLocale(path, NULL); - if (fname == NULL) { - errno = EINVAL; - return -1; - } - err = stat(fname, buf); - PyMem_Free(fname); - return err; -} - - #ifdef MS_WINDOWS static __int64 secs_between_epochs = 11644473600; /* Seconds between 1.1.1601 and 1.1.1970 */ |