]> Dogcows Code - chaz/tar/commitdiff
Minor change
authorSergey Poznyakoff <gray@gnu.org.ua>
Fri, 14 Feb 2014 08:44:19 +0000 (10:44 +0200)
committerSergey Poznyakoff <gray@gnu.org.ua>
Fri, 14 Feb 2014 08:44:19 +0000 (10:44 +0200)
* src/tar.c (decode_options): Silently ignore --one-top-level
if used with a non-reading command.

src/tar.c

index f36e1518455baa8e91abac3473abca73608de25f..85248091b98b149743d76406805baf6093f8ca28 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -2549,22 +2549,22 @@ decode_options (int argc, char **argv)
     {
       char *base;
       
-      if (!IS_SUBCOMMAND_CLASS (SUBCL_READ))
-       option_conflict_error ("--one-top-level",
-                              subcommand_string (subcommand_option));
       if (absolute_names_option)
        option_conflict_error ("--one-top-level", "--absolute-names");
       
-      /* If the user wants to guarantee that everything is under one directory,
-        determine its name now and let it be created later.  */
-      base = base_name (archive_name_array[0]);
-      one_top_level_dir = strip_compression_suffix (base);
-      free (base);
-         
       if (!one_top_level_dir)
-       USAGE_ERROR ((0, 0,
-                     _("Cannot deduce top-level directory name; "
-                       "please set it explicitly with --one-top-level=DIR")));
+       {
+         /* If the user wants to guarantee that everything is under one
+            directory, determine its name now and let it be created later.  */
+         base = base_name (archive_name_array[0]);
+         one_top_level_dir = strip_compression_suffix (base);
+         free (base);
+
+         if (!one_top_level_dir)
+           USAGE_ERROR ((0, 0,
+                         _("Cannot deduce top-level directory name; "
+                           "please set it explicitly with --one-top-level=DIR")));
+       }
     }
 
   /* If ready to unlink hierarchies, so we are for simpler files.  */
This page took 0.025321 seconds and 4 git commands to generate.