talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 4256dfbdc81c5a900cf577bae38847bb803a45c7
parent 9ef66c7e8a648f99d796657b9d6bd9f128cd1fea
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Mon,  3 Aug 2015 23:24:05 +0200

Remove broken reimplementation of a few Glib file functions.

This fixes bug #3454, and probably a few more.

Diffstat:
Msrc/common/utils.c | 118-------------------------------------------------------------------------------
1 file changed, 0 insertions(+), 118 deletions(-)

diff --git a/src/common/utils.c b/src/common/utils.c @@ -100,124 +100,6 @@ gboolean superuser_p (void) #endif } - - -#if !defined(G_OS_UNIX) -gint g_chdir(const gchar *path) -{ -#ifdef G_OS_WIN32 - if (G_WIN32_HAVE_WIDECHAR_API()) { - wchar_t *wpath; - gint retval; - gint save_errno; - - wpath = g_utf8_to_utf16(path, -1, NULL, NULL, NULL); - if (wpath == NULL) { - errno = EINVAL; - return -1; - } - - retval = _wchdir(wpath); - save_errno = errno; - - g_free(wpath); - - errno = save_errno; - return retval; - } else { - gchar *cp_path; - gint retval; - gint save_errno; - - cp_path = g_locale_from_utf8(path, -1, NULL, NULL, NULL); - if (cp_path == NULL) { - errno = EINVAL; - return -1; - } - - retval = chdir(cp_path); - save_errno = errno; - - g_free(cp_path); - - errno = save_errno; - return retval; - } -#else - return chdir(path); -#endif -} - -gint g_chmod(const gchar *path, gint mode) -{ -#ifdef G_OS_WIN32 - if (G_WIN32_HAVE_WIDECHAR_API()) { - wchar_t *wpath; - gint retval; - gint save_errno; - - wpath = g_utf8_to_utf16(path, -1, NULL, NULL, NULL); - if (wpath == NULL) { - errno = EINVAL; - return -1; - } - - retval = _wchmod(wpath, mode); - save_errno = errno; - - g_free(wpath); - - errno = save_errno; - return retval; - } else { - gchar *cp_path; - gint retval; - gint save_errno; - - cp_path = g_locale_from_utf8(path, -1, NULL, NULL, NULL); - if (cp_path == NULL) { - errno = EINVAL; - return -1; - } - - retval = chmod(cp_path, mode); - save_errno = errno; - - g_free(cp_path); - - errno = save_errno; - return retval; - } -#else - return chmod(path, mode); -#endif -} - -FILE* g_fopen(const gchar *filename, const gchar *mode) -{ -#ifdef G_OS_WIN32 - char *name = g_win32_locale_filename_from_utf8(filename); - FILE* fp = fopen(name, mode); - g_free(name); - return fp; -#else - return fopen(filename, mode); -#endif -} -int g_open(const gchar *filename, int flags, int mode) -{ -#ifdef G_OS_WIN32 - char *name = g_win32_locale_filename_from_utf8(filename); - int fd = open(name, flags, mode); - g_free(name); - return fd; -#else - return open(filename, flags, mode); -#endif -} -#endif /* G_OS_UNIX */ - - GSList *slist_copy_deep(GSList *list, GCopyFunc func) { #if GLIB_CHECK_VERSION(2, 34, 0)