[PATCH 2/3] notmuch-restore: replace continue with if

Subject: [PATCH 2/3] notmuch-restore: replace continue with if

Date: Sun, 16 Dec 2012 16:16:36 -0400

To: notmuch@notmuchmail.org

Cc: David Bremner

From: david@tethera.net


From: David Bremner <bremner@debian.org>

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


Thread: