--- a/src/win32/libc_interface.c Tue Feb 15 20:42:17 2005 -0500
+++ b/src/win32/libc_interface.c Tue Feb 15 22:45:55 2005 -0500
@@ -34,7 +34,13 @@
#include "libc_internal.h"
+#if GLIB_CHECK_VERSION(2,6,0) +# include <glib/gstdio.h> @@ -310,15 +316,15 @@
int wgaim_rename (const char *oldname, const char *newname) {
- struct _stat oldstat, newstat;
+ struct stat oldstat, newstat; - if(_stat(oldname, &oldstat) == 0) {
+ if(g_stat(oldname, &oldstat) == 0) { - if(_stat(newname, &newstat) == 0) {
+ if(g_stat(newname, &newstat) == 0) { if(_S_ISDIR(oldstat.st_mode)) {
if(!_S_ISDIR(newstat.st_mode)) {
- return rename(oldname, newname);
+ return g_rename(oldname, newname); @@ -327,7 +333,7 @@
deleted and oldname should be renamed.
gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "wgaim_rename does not behave here as it should\n");
- return rename(oldname, newname);
+ return g_rename(oldname, newname); /* oldname is not a dir */
@@ -339,14 +345,14 @@
/* newname is not a dir */
- return rename(oldname, newname);
+ return g_rename(oldname, newname); /* newname doesn't exist */
- return rename(oldname, newname);
+ return g_rename(oldname, newname); /* oldname doesn't exist */
--- a/src/win32/libc_interface.h Tue Feb 15 20:42:17 2005 -0500
+++ b/src/win32/libc_interface.h Tue Feb 15 22:45:55 2005 -0500
@@ -129,6 +129,16 @@
#define rename( oldname, newname ) \
wgaim_rename( oldname, newname )
+#if GLIB_CHECK_VERSION(2,6,0) +/* This is necessary because we want rename on win32 to be able to overwrite an existing file, it is done in internal.h if GLib < 2.6*/ +#define g_rename(oldname, newname) \ +wgaim_rename(oldname, newname) #if !GLIB_CHECK_VERSION(2,6,0)