ソースを参照

(decode_options): Initialize `excluded'.
Use new add_exclude_file and add_exclude functions.

Paul Eggert 26 年 前
コミット
07f380748c
1 ファイル変更4 行追加4 行削除
  1. 4 4
      src/tar.c

+ 4 - 4
src/tar.c

@@ -452,6 +452,7 @@ decode_options (int argc, char *const *argv)
   archive_format = DEFAULT_FORMAT;
   blocking_factor = DEFAULT_BLOCKING;
   record_size = DEFAULT_BLOCKING * BLOCKSIZE;
+  excluded = new_exclude ();
 
   owner_option = -1;
   group_option = -1;
@@ -783,8 +784,8 @@ decode_options (int argc, char *const *argv)
 	break;
 
       case 'X':
-	exclude_option = 1;
-	add_exclude_file (optarg);
+	if (add_exclude_file (excluded, optarg, '\n') != 0)
+	  FATAL_ERROR ((0, errno, "%s", optarg));
 	break;
 
       case 'z':
@@ -810,8 +811,7 @@ decode_options (int argc, char *const *argv)
 	break;
 
       case EXCLUDE_OPTION:
-	exclude_option = 1;
-	add_exclude (optarg);
+	add_exclude (excluded, optarg);
 	break;
 
       case GROUP_OPTION: