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

david at tethera.net david at tethera.net
Sun Dec 16 12:16:36 PST 2012


From: David Bremner <bremner at 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



More information about the notmuch mailing list