From 57e9361f3cc04383832cff60c939b65b51d31604 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 17 Dec 2012 16:16:36 +2000 Subject: [PATCH] [PATCH 2/3] notmuch-restore: replace continue with if --- ae/7a6edd0a7e7884492321174a8278c63a6ea12e | 91 +++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 ae/7a6edd0a7e7884492321174a8278c63a6ea12e diff --git a/ae/7a6edd0a7e7884492321174a8278c63a6ea12e b/ae/7a6edd0a7e7884492321174a8278c63a6ea12e new file mode 100644 index 000000000..c675521da --- /dev/null +++ b/ae/7a6edd0a7e7884492321174a8278c63a6ea12e @@ -0,0 +1,91 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id B8097431FC4 + for ; Sun, 16 Dec 2012 12:16:59 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id DvdcZsTPOZRF for ; + Sun, 16 Dec 2012 12:16:58 -0800 (PST) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 04556431E62 + for ; Sun, 16 Dec 2012 12:16:58 -0800 (PST) +Received: from fctnnbsc30w-142167090129.dhcp-dynamic.fibreop.nb.bellaliant.net + ([142.167.90.129] helo=zancas.localnet) + by tesseract.cs.unb.ca with esmtpsa + (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) + (envelope-from ) + id 1TkKdt-0007tc-3t; Sun, 16 Dec 2012 16:16:57 -0400 +Received: from bremner by zancas.localnet with local (Exim 4.80) + (envelope-from ) + id 1TkKdn-00050e-MI; Sun, 16 Dec 2012 16:16:51 -0400 +From: david@tethera.net +To: notmuch@notmuchmail.org +Subject: [PATCH 2/3] notmuch-restore: replace continue with if +Date: Sun, 16 Dec 2012 16:16:36 -0400 +Message-Id: <1355688997-19164-3-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1355688997-19164-1-git-send-email-david@tethera.net> +References: <1355688997-19164-1-git-send-email-david@tethera.net> +X-Spam_bar: - +Cc: David Bremner +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 16 Dec 2012 20:17:00 -0000 + +From: David Bremner + +It is maybe a bit counter-intuitive with the condition reversed like +this, but it makes the memory handling fix in the next patch easier. +--- + notmuch-restore.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/notmuch-restore.c b/notmuch-restore.c +index ae0ef45..4b76d83 100644 +--- a/notmuch-restore.c ++++ b/notmuch-restore.c +@@ -228,12 +228,15 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) + } + } + +- if (ret > 0) +- continue; +- +- if (ret < 0 || tag_message (ctx, notmuch, query_string, +- tag_ops, flags)) +- break; ++ if (ret <= 0) { ++ if (ret < 0) ++ break; ++ ++ ret = tag_message (line_ctx, notmuch, query_string, ++ tag_ops, flags); ++ if (ret < 0) ++ break; ++ } + + } while ((line_len = getline (&line, &line_size, input)) != -1); + +-- +1.7.10.4 + -- 2.26.2