diff options
author | Austin Clements <amdragon@mit.edu> | 2011-02-08 20:56:31 -0500 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2011-09-13 22:00:15 -0300 |
commit | bdaee77e1b0853b0dab00565e4c5b6164248f85a (patch) | |
tree | 550ce666f3d82cf4781f44300112161d20dc34d7 /notmuch-new.c | |
parent | 73ed66a501537fc145b6b6250513ec94c7b7e659 (diff) |
new: Don't lose messages on SIGINT.
Previously, message removals were always performed, even after a
SIGINT. As a result, when a message was moved from one folder to
another, a SIGINT between processing the directory the message was
removed from and processing the directory it was added to would result
in notmuch removing that message from the database.
Diffstat (limited to 'notmuch-new.c')
-rw-r--r-- | notmuch-new.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/notmuch-new.c b/notmuch-new.c index 7d17793b..b734e5b9 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -868,7 +868,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) removed_files = 0; renamed_files = 0; gettimeofday (&tv_start, NULL); - for (f = add_files_state.removed_files->head; f; f = f->next) { + for (f = add_files_state.removed_files->head; f && !interrupted; f = f->next) { status = notmuch_database_remove_message (notmuch, f->filename); if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) renamed_files++; @@ -883,7 +883,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) } gettimeofday (&tv_start, NULL); - for (f = add_files_state.removed_directories->head, i = 0; f; f = f->next, i++) { + for (f = add_files_state.removed_directories->head, i = 0; f && !interrupted; f = f->next, i++) { _remove_directory (ctx, notmuch, f->filename, &renamed_files, &removed_files); if (do_print_progress) { |