From a6e39d6a445297be1214aad5d603e8c3d62ecb36 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 22 Mar 2014 19:34:21 -0700 Subject: * utf8.c (w_fopen, w_popen, w_freopen, w_remove, w_rename): Revert 2014-03-14 changes. --- ChangeLog | 5 +++++ utf8.c | 20 -------------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45624ab8..07556c2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-03-22 Kaz Kylheku + + * utf8.c (w_fopen, w_popen, w_freopen, w_remove, w_rename): Revert + 2014-03-14 changes. + 2014-03-21 Kaz Kylheku * eval.c (me_when): New static function. diff --git a/utf8.c b/utf8.c index 51a61371..e3ef3e7a 100644 --- a/utf8.c +++ b/utf8.c @@ -359,68 +359,48 @@ wint_t utf8_decode(utf8_decoder_t *ud, int (*get)(mem_t *ctx), mem_t *ctx) FILE *w_fopen(const wchar_t *wname, const wchar_t *wmode) { -#ifdef _WIN32 - return _wfopen(wname, wmode); -#else char *name = utf8_dup_to(wname); char *mode = utf8_dup_to(wmode); FILE *f = fopen(name, mode); free(name); free(mode); return f; -#endif } FILE *w_popen(const wchar_t *wcmd, const wchar_t *wmode) { -#ifdef _WIN32 - return _wpopen(wcmd, wmode); -#else char *cmd = utf8_dup_to(wcmd); char *mode = utf8_dup_to(wmode); FILE *f = popen(cmd, mode); free(cmd); free(mode); return f; -#endif } FILE *w_freopen(const wchar_t *wname, const wchar_t *wmode, FILE *fold) { -#ifdef _WIN32 - return _wfreopen(wname, wmode, fold); -#else char *name = utf8_dup_to(wname); char *mode = utf8_dup_to(wmode); FILE *f = fold ? freopen(name, mode, fold) : fopen(name, mode); free(name); free(mode); return f; -#endif } int w_remove(const wchar_t *wpath) { -#ifdef _WIN32 - return _wremove(wpath); -#else char *path = utf8_dup_to(wpath); int err = remove(path); free(path); return err; -#endif } int w_rename(const wchar_t *wfrom, const wchar_t *wto) { -#ifdef _WIN32 - return _wrename(wfrom, wto); -#else char *from = utf8_dup_to(wfrom); char *to = utf8_dup_to(wto); int err = rename(from, to); free(to); free(from); return err; -#endif } -- cgit v1.2.3