summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-02-14 10:44:19 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-02-14 10:44:19 +0200
commit46da9968df4bad8ce3899f98000aa5612375d29f (patch)
tree0fb02a3157c72523aa907e87ac7e5fb3b3bfe73b
parent29a6964af3e1baabe978ce608e0466e1250d08ab (diff)
downloadtar-46da9968df4bad8ce3899f98000aa5612375d29f.tar.gz
Minor change
* src/tar.c (decode_options): Silently ignore --one-top-level if used with a non-reading command.
-rw-r--r--src/tar.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/tar.c b/src/tar.c
index f36e1518..85248091 100644
--- 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. */