changeset 22505:22fef6b952a0

I was wondering why the more sane error messges were never appearing... now I know. There is also a fix here that uses glib's internal rename stuff on recent versions because it is more robust than our win32 version.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 17 Mar 2008 20:32:02 +0000
parents a65a76072f31
children 2ded253bcdbb
files libpurple/win32/libc_interface.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/win32/libc_interface.c	Mon Mar 17 14:43:28 2008 +0000
+++ b/libpurple/win32/libc_interface.c	Mon Mar 17 20:32:02 2008 +0000
@@ -320,12 +320,16 @@
 		switch(errornum) {
 			case WSAECONNABORTED: /* 10053 */
 				snprintf(errbuf, sizeof(errbuf), _("Connection interrupted by other software on your computer."));
+				break;
 			case WSAECONNRESET: /* 10054 */
 				snprintf(errbuf, sizeof(errbuf), _("Remote host closed connection."));
+				break;
 			case WSAETIMEDOUT: /* 10060 */
 				snprintf(errbuf, sizeof(errbuf), _("Connection timed out."));
+				break;
 			case WSAECONNREFUSED: /*10061 */
 				snprintf(errbuf, sizeof(errbuf), _("Connection refused."));
+				break;
 			default:
 				snprintf(errbuf, sizeof(errbuf), "Windows socket error #%d", errornum);
 		}
@@ -452,6 +456,11 @@
 int wpurple_rename (const char *oldname, const char *newname) {
 	struct stat oldstat, newstat;
 
+	/* As of Glib 2.8.5, g_rename() uses MoveFileEx() with MOVEFILE_REPLACE_EXISTING to behave more sanely */
+	if (glib_check_version(2, 8, 5) == NULL) {
+		return g_rename(oldname, newname);
+	}
+
 	if(g_stat(oldname, &oldstat) == 0) {
 		/* newname exists */
 		if(g_stat(newname, &newstat) == 0) {