]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch search: Fix missing final newline in "notmuch search --output=tags"
authorCarl Worth <cworth@cworth.org>
Wed, 24 Nov 2010 01:58:00 +0000 (17:58 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 24 Nov 2010 01:58:00 +0000 (17:58 -0800)
As mentioned in the recent test commits, this also fixes the missing
'[' and ']' characters in the --format=json variant of "notmuch search
--output=tags" as well.

notmuch-search.c

index bb989dac854bc7f12f4207c5a4eaa237d1401309..c628b369b66fadd975821261b4169e91c78ac3ca 100644 (file)
@@ -319,7 +319,9 @@ do_search_tags (const void *ctx,
     {
        tag = notmuch_tags_get (tags);
 
-       if (! first_tag)
+       if (first_tag)
+           fputs (format->results_start, stdout);
+       else
            fputs (format->item_sep, stdout);
 
        format->item_id (ctx, "", tag);
@@ -332,6 +334,9 @@ do_search_tags (const void *ctx,
     if (messages)
        notmuch_messages_destroy (messages);
 
+    if (! first_tag)
+       fputs (format->results_end, stdout);
+
     return 0;
 }