mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
notmuch restore: Don't bother printing tag values.
The code was just a little messy here with three parallel conditions testing for message == NULL.
This commit is contained in:
parent
ae0bd3f503
commit
9c4efa8487
1 changed files with 11 additions and 17 deletions
12
notmuch.c
12
notmuch.c
|
@ -849,8 +849,9 @@ restore_command (int argc, char *argv[])
|
||||||
|
|
||||||
message = notmuch_database_find_message (notmuch, message_id);
|
message = notmuch_database_find_message (notmuch, message_id);
|
||||||
if (message == NULL) {
|
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);
|
message_id);
|
||||||
|
goto NEXT_LINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
next = tags;
|
next = tags;
|
||||||
|
@ -858,7 +859,6 @@ restore_command (int argc, char *argv[])
|
||||||
tag = strsep (&next, " ");
|
tag = strsep (&next, " ");
|
||||||
if (*tag == '\0')
|
if (*tag == '\0')
|
||||||
continue;
|
continue;
|
||||||
if (message) {
|
|
||||||
status = notmuch_message_add_tag (message, tag);
|
status = notmuch_message_add_tag (message, tag);
|
||||||
if (status) {
|
if (status) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
|
@ -867,17 +867,11 @@ restore_command (int argc, char *argv[])
|
||||||
fprintf (stderr, "%s\n",
|
fprintf (stderr, "%s\n",
|
||||||
notmuch_status_to_string (status));
|
notmuch_status_to_string (status));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
fprintf (stderr, "%s%s",
|
|
||||||
tag == tags ? "" : " ", tag);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message)
|
|
||||||
notmuch_message_destroy (message);
|
notmuch_message_destroy (message);
|
||||||
else
|
|
||||||
fprintf (stderr, ")\n");
|
|
||||||
}
|
}
|
||||||
|
NEXT_LINE:
|
||||||
free (message_id);
|
free (message_id);
|
||||||
free (tags);
|
free (tags);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue