summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-01-11 11:37:10 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-01-11 11:37:33 -0800
commit9a82a0215b971725c835c640fb5f6e5b47ac214e (patch)
tree16b51bd9b9154516b1b05718c63ff56773af8d0a
parent03858cf583ce299b836d8a848967ce290a6bf303 (diff)
downloadtar-9a82a0215b971725c835c640fb5f6e5b47ac214e.tar.gz
tar: fix core dump with --index-file=bad_path
* src/tar.c (decode_options): Exit cleanly if index file won't open. Problem reported by Khanh-Dang Nguyen Thu Lam in <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00018.html>.
-rw-r--r--src/tar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tar.c b/src/tar.c
index 21d99107..9cea7a5a 100644
--- a/src/tar.c
+++ b/src/tar.c
@@ -1549,7 +1549,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
/* Don't replace existing files. */
old_files_option = KEEP_OLD_FILES;
break;
-
+
case 'K':
starting_file_option = true;
addname (arg, 0, true, NULL);
@@ -2606,7 +2606,7 @@ decode_options (int argc, char **argv)
{
stdlis = fopen (index_file_name, "w");
if (! stdlis)
- open_error (index_file_name);
+ open_fatal (index_file_name);
}
else
stdlis = to_stdout_option ? stderr : stdout;