]> Dogcows Code - chaz/tar/commitdiff
tar: fix core dump with --index-file=bad_path
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 11 Jan 2012 19:37:10 +0000 (11:37 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 11 Jan 2012 19:37:33 +0000 (11:37 -0800)
* 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>.

src/tar.c

index 21d9910712ed8aea12f2bef2ea4a984e019a6f74..9cea7a5a463aef57bae31751774263b7f6732087 100644 (file)
--- 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;
This page took 0.021928 seconds and 4 git commands to generate.