浏览代码

(decode_options): Initialize stdlis

Sergey Poznyakoff 18 年之前
父节点
当前提交
36fe16aaf5
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      src/tar.c

+ 10 - 0
src/tar.c

@@ -2198,6 +2198,16 @@ decode_options (int argc, char **argv)
       break;
     }
 
+  /* Initialize stdlis */
+  if (index_file_name)
+    {
+      stdlis = fopen (index_file_name, "w");
+      if (! stdlis)
+	open_error (index_file_name);
+    }
+  else
+    stdlis = to_stdout_option ? stderr : stdout;
+
   archive_name_cursor = archive_name_array;
 
   /* Prepare for generating backup names.  */