[dovecot-cvs] dovecot/src/plugins/quota quota-dict.c,1.19,1.20
tss at dovecot.org
tss at dovecot.org
Tue Apr 3 07:44:36 EEST 2007
Update of /var/lib/cvs/dovecot/src/plugins/quota
In directory talvi:/tmp/cvs-serv7266
Modified Files:
quota-dict.c
Log Message:
Recalculate quota if it's negative.
Index: quota-dict.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota-dict.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- quota-dict.c 14 Feb 2007 19:32:06 -0000 1.19
+++ quota-dict.c 3 Apr 2007 04:44:34 -0000 1.20
@@ -116,14 +116,15 @@
DICT_QUOTA_CURRENT_COUNT_PATH, &value);
if (ret < 0)
*value_r = 0;
- else if (ret == 0)
- ret = dict_quota_count(root, want_bytes, value_r);
else {
long long tmp;
- /* don't break in case the quota value is negative. */
- tmp = strtoll(value, NULL, 10);
- *value_r = tmp < 0 ? 0 : tmp;
+ /* recalculate quota if it's negative */
+ tmp = ret == 0 ? -1 : strtoll(value, NULL, 10);
+ if (tmp < 0)
+ ret = dict_quota_count(root, want_bytes, value_r);
+ else
+ *value_r = tmp;
}
t_pop();
More information about the dovecot-cvs
mailing list