X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.c;h=d76425213dba3ffc6d76f4da66081d19e503887c;hp=cedfebce4c029159cfa23f8960757f7006758200;hb=8ad4350fef132b016bbab5eeb1c4a713e51035c6;hpb=466a7bbf620e4bf1b57097a6d3c474159c475b6d diff --git a/notmuch.c b/notmuch.c index cedfebce..d7642521 100644 --- a/notmuch.c +++ b/notmuch.c @@ -99,7 +99,7 @@ add_files_print_progress (add_files_state_t *state) state->count, state->total_messages); print_formatted_seconds ((state->total_messages - state->count) / rate_overall); - printf (" remaining).\r"); + printf (" remaining). \r"); fflush (stdout); } @@ -384,7 +384,7 @@ dump_command (int argc, char *argv[]) output = fopen (argv[0], "w"); if (output == NULL) { fprintf (stderr, "Error opening %s for writing: %s\n", - argv[1], strerror (errno)); + argv[0], strerror (errno)); ret = 1; goto DONE; } @@ -398,7 +398,7 @@ dump_command (int argc, char *argv[]) goto DONE; } - query = notmuch_query_create (notmuch, NOTMUCH_QUERY_ALL); + query = notmuch_query_create (notmuch, ""); if (query == NULL) { fprintf (stderr, "Out of memory\n"); ret = 1; @@ -411,6 +411,7 @@ dump_command (int argc, char *argv[]) notmuch_results_has_more (results); notmuch_results_advance (results)) { + int first = 1; message = notmuch_results_get (results); fprintf (output, @@ -420,8 +421,6 @@ dump_command (int argc, char *argv[]) notmuch_tags_has_more (tags); notmuch_tags_advance (tags)) { - int first = 1; - if (! first) fprintf (output, " "); @@ -431,6 +430,8 @@ dump_command (int argc, char *argv[]) } fprintf (output, ")\n"); + + notmuch_message_destroy (message); } notmuch_query_destroy (query);