static int
tag_message (unused (void *ctx),
notmuch_database_t *notmuch,
static int
tag_message (unused (void *ctx),
notmuch_database_t *notmuch,
status = notmuch_database_find_message (notmuch, message_id, &message);
if (status || message == NULL) {
status = notmuch_database_find_message (notmuch, message_id, &message);
if (status || message == NULL) {
message ? "" : "missing ", message_id);
if (status)
fprintf (stderr, "%s\n", notmuch_status_to_string (status));
message ? "" : "missing ", message_id);
if (status)
fprintf (stderr, "%s\n", notmuch_status_to_string (status));
/* In order to detect missing messages, this check/optimization is
* intentionally done *after* first finding the message. */
if ((flags & TAG_FLAG_REMOVE_ALL) || tag_op_list_size (tag_ops))
/* In order to detect missing messages, this check/optimization is
* intentionally done *after* first finding the message. */
if ((flags & TAG_FLAG_REMOVE_ALL) || tag_op_list_size (tag_ops))
- if (ret < 0 || tag_message (ctx, notmuch, query_string,
- tag_ops, flags))
+ if (ret < 0)
+ break;
+
+ ret = tag_message (ctx, notmuch, query_string,
+ tag_ops, flags);
+ if (ret)