summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-06-22 11:04:06 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-06-28 13:03:18 +0100
commit528b1e8c0db12c5b4cdbccbbd45107fd4f54ac8a (patch)
tree302d25d34e45a50ab34c06f3e380b2c56802d132
parent3c8793dd6f9ae34bccfbb71a7d46dc353d04dc1e (diff)
downloadevolution-data-server-528b1e8c0db12c5b4cdbccbbd45107fd4f54ac8a.tar.gz
Fix division-by-zero in imapx message fetch
Use ifolder->exists_on_server, not imap->exists (which could have come from a STATUS command and be the value for some other folder). And it's possible to get here when we thought there were no messages, so add ?:1 to avoid the division by zero in that case too. (cherry picked from commit 79107d2547812926f51343b23e551da794f2a8a7)
-rw-r--r--camel/providers/imapx/camel-imapx-server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index e11ac4852..2cca90c46 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -1354,7 +1354,8 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
}
if (job->op)
- camel_operation_progress (job->op, (camel_folder_summary_count (job->folder->summary) * 100)/imap->exists);
+ camel_operation_progress (job->op, (camel_folder_summary_count (job->folder->summary)
+ * 100)/ifolder->exists_on_server?:1);
}
}
}