From 29d980ea1fb0f21736d3279d2ec26ef6d9719d40 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 13 Feb 2019 14:45:52 -0800 Subject: [PATCH] Keep deleting after first failure. --- nuke.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nuke.c b/nuke.c index a1b840c..7cbb5bc 100644 --- a/nuke.c +++ b/nuke.c @@ -398,6 +398,7 @@ int main(int argc, char *argv[]) exit_success: curs_set(1); /* unhide cursor */ endwin(); /* Exit ncurses */ + int exit_status = EXIT_SUCCESS; if (!testing) { for (int i = 0; i < num_files; i++) { int failure; @@ -412,11 +413,11 @@ int main(int argc, char *argv[]) printf("%s\n", files[i]); } else { printf("Error: unable to delete %s (%s)\n", files[i], strerror(errno)); - return EXIT_FAILURE; + exit_status = EXIT_FAILURE; } } } - return EXIT_SUCCESS; + return exit_status; exit_failure: curs_set(1); /* unhide cursor */