aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.c
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-10-26 22:19:08 -0700
committerGravatar Carl Worth <cworth@cworth.org>2009-10-26 22:19:08 -0700
commit9c4efa8487d292268d9ae6a089b1063c6e82e6e4 (patch)
tree30ca0a47efdddc6b38cd9ce9619f1194e7886b6d /notmuch.c
parentae0bd3f503c8815affa733f48498bb77d023680b (diff)
notmuch restore: Don't bother printing tag values.
The code was just a little messy here with three parallel conditions testing for message == NULL.
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/notmuch.c b/notmuch.c
index f620f58d..3b0182a9 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -849,8 +849,9 @@ restore_command (int argc, char *argv[])
message = notmuch_database_find_message (notmuch, message_id);
if (message == NULL) {
- fprintf (stderr, "Warning: Cannot apply tags to missing message: %s (",
+ fprintf (stderr, "Warning: Cannot apply tags to missing message: %s\n",
message_id);
+ goto NEXT_LINE;
}
next = tags;
@@ -858,26 +859,19 @@ restore_command (int argc, char *argv[])
tag = strsep (&next, " ");
if (*tag == '\0')
continue;
- if (message) {
- status = notmuch_message_add_tag (message, tag);
- if (status) {
- fprintf (stderr,
- "Error applying tag %s to message %s:\n",
- tag, message_id);
- fprintf (stderr, "%s\n",
- notmuch_status_to_string (status));
- }
- } else {
- fprintf (stderr, "%s%s",
- tag == tags ? "" : " ", tag);
+ status = notmuch_message_add_tag (message, tag);
+ if (status) {
+ fprintf (stderr,
+ "Error applying tag %s to message %s:\n",
+ tag, message_id);
+ fprintf (stderr, "%s\n",
+ notmuch_status_to_string (status));
}
}
- if (message)
- notmuch_message_destroy (message);
- else
- fprintf (stderr, ")\n");
+ notmuch_message_destroy (message);
}
+ NEXT_LINE:
free (message_id);
free (tags);
}