im.pidgin.pidgin: 561d7f407332ec3fa6e4ab58c85a3bc7a2f2d8b7

datallah at pidgin.im datallah at pidgin.im
Thu Dec 27 11:35:46 EST 2007


-----------------------------------------------------------------
Revision: 561d7f407332ec3fa6e4ab58c85a3bc7a2f2d8b7
Ancestor: 3fe2872dbe1368f8043db524de4b9f8a35bb56e6
Author: datallah at pidgin.im
Date: 2007-12-27T16:29:58
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkft.c

ChangeLog: 

Prevent a divide by zero. Fixes #4490.

-------------- next part --------------
============================================================
--- pidgin/gtkft.c	a572f6de2488e0e5190efab93748b3c564d0cd92
+++ pidgin/gtkft.c	dd5b2d29d17f2c51474ca3344fbb7da83658f3f1
@@ -156,15 +156,15 @@ get_xfer_info_strings(PurpleXfer *xfer, 
 	}
 
 	if (time_remaining != NULL) {
-		if (purple_xfer_get_size(xfer) == 0) {
-			*time_remaining = g_strdup(_("Unknown"));
-		}
-		else if (purple_xfer_is_completed(xfer)) {
+		if (purple_xfer_is_completed(xfer)) {
 			*time_remaining = g_strdup(_("Finished"));
 		}
 		else if (purple_xfer_is_canceled(xfer)) {
 			*time_remaining = g_strdup(_("Canceled"));
 		}
+		else if (purple_xfer_get_size(xfer) == 0 || (kb_sent > 0 && kbps == 0)) {
+			*time_remaining = g_strdup(_("Unknown"));
+		}
 		else if (kb_sent <= 0) {
 			*time_remaining = g_strdup(_("Waiting for transfer to begin"));
 		}


More information about the Commits mailing list