X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-restore.c;h=f03dcaca1b69da1ea1a86103ed80c0a06dd65cd5;hp=08d5adcbe42271a1660bb56079c488052b5ab520;hb=7beeb8c88a014ecbc53d8241f10683b3c4c16228;hpb=19c824c3fd7be29a2257cdd530ee23074c978d63 diff --git a/notmuch-restore.c b/notmuch-restore.c index 08d5adcb..f03dcaca 100644 --- a/notmuch-restore.c +++ b/notmuch-restore.c @@ -38,13 +38,13 @@ tag_message (notmuch_database_t *notmuch, const char *message_id, fprintf (stderr, "Warning: Cannot apply tags to %smessage: %s\n", message ? "" : "missing ", message_id); if (status) - fprintf (stderr, "%s\n", notmuch_status_to_string(status)); + fprintf (stderr, "%s\n", notmuch_status_to_string (status)); return 1; } /* In order to detect missing messages, this check/optimization is * intentionally done *after* first finding the message. */ - if (!remove_all && (file_tags == NULL || *file_tags == '\0')) + if (! remove_all && (file_tags == NULL || *file_tags == '\0')) goto DONE; db_tags_str = NULL; @@ -88,7 +88,7 @@ tag_message (notmuch_database_t *notmuch, const char *message_id, if (synchronize_flags) notmuch_message_tags_to_maildir_flags (message); -DONE: + DONE: if (message) notmuch_message_destroy (message); @@ -141,13 +141,12 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) input_file_name, strerror (errno)); return 1; } - optind++; } if (opt_index < argc) { fprintf (stderr, - "Cannot read dump from more than one file: %s\n", - argv[optind]); + "Unused positional parameter: %s\n", + argv[opt_index]); return 1; } @@ -158,7 +157,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) if ( xregcomp (®ex, "^([^ ]+) \\(([^)]*)\\)$", REG_EXTENDED) ) - INTERNAL_ERROR("compile time constant regex failed."); + INTERNAL_ERROR ("compile time constant regex failed."); while ((line_len = getline (&line, &line_size, input)) != -1) { regmatch_t match[3]; @@ -167,8 +166,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) chomp_newline (line); rerr = xregexec (®ex, line, 3, match, 0); - if (rerr == REG_NOMATCH) - { + if (rerr == REG_NOMATCH) { fprintf (stderr, "Warning: Ignoring invalid input line: %s\n", line); continue; @@ -179,7 +177,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) file_tags = xstrndup (line + match[2].rm_so, match[2].rm_eo - match[2].rm_so); - tag_message (notmuch, message_id, file_tags, !accumulate, + tag_message (notmuch, message_id, file_tags, ! accumulate, synchronize_flags); free (message_id);