From 9afc18c0a1ec9fa13b79e89b8c7eef763bd07089 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sun, 19 Apr 2009 08:44:11 -0400 Subject: [PATCH] Fixed "xfer_progress=0". --- src/commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands.c b/src/commands.c index 318c6a91..6d3a7074 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1507,7 +1507,7 @@ static gpg_error_t xfer_data(assuan_context_t ctx, const gchar *line, struct assuan_cmd_s data; int progress = get_key_file_integer("global", "xfer_progress"); - progress = (progress / ASSUAN_LINELENGTH) * ASSUAN_LINELENGTH; + progress = progress>0 ? (progress/ASSUAN_LINELENGTH)*ASSUAN_LINELENGTH : 0; if (total < ASSUAN_LINELENGTH) to_send = total; @@ -1531,7 +1531,7 @@ static gpg_error_t xfer_data(assuan_context_t ctx, const gchar *line, if (!rc) { sent += to_send; - if (!(sent % progress) || sent == total) + if ((progress && !(sent % progress)) || sent == total) rc = send_status(ctx, STATUS_XFER, "%li %li", sent, total); } -- 2.11.4.GIT