X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=e0e3de25cf6ef8051ebc1304933668bcbc8b2497;hp=f079f62a63968c7ce19a2045de428864eb82e399;hb=b860be6a765b421f755a7c1b054f6b9a39b129c0;hpb=60ddce8a161772583e8d223498997ee866d04ede diff --git a/notmuch-new.c b/notmuch-new.c index f079f62a..e0e3de25 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -388,8 +388,11 @@ add_file (notmuch_database_t *notmuch, const char *filename, notmuch_message_maildir_flags_to_tags (message); for (tag = state->new_tags; *tag != NULL; tag++) { - if (strcmp ("unread", *tag) != 0 || - ! notmuch_message_has_maildir_flag (message, 'S')) { + notmuch_bool_t is_set; + /* Currently all errors from has_maildir_flag are fatal */ + if ((status = notmuch_message_has_maildir_flag_st (message, 'S', &is_set))) + goto DONE; + if (strcmp ("unread", *tag) != 0 || ! is_set) { notmuch_message_add_tag (message, *tag); } } @@ -1040,7 +1043,7 @@ print_results (const add_files_state_t *state) } int -notmuch_new_command (notmuch_config_t *config, int argc, char *argv[]) +notmuch_new_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch), int argc, char *argv[]) { notmuch_database_t *notmuch; add_files_state_t add_files_state = {