From: David Bremner <brem...@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

Reply via email to