From 934805aec1b666f347429324652f28af3206858d Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Fri, 18 Oct 2002 23:59:40 +0000 Subject: [PATCH] Put bac kthe code that handles cases where a '-' wasnt specified prior to the options. --- archival/tar.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/archival/tar.c b/archival/tar.c index dba6bbcc4..a34eb3ca1 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -615,6 +615,14 @@ int tar_main(int argc, char **argv) unsigned char tar_create = FALSE; #endif + /* Prepend '-' to the first argument if required */ + if (argv[1][0] != '-') { + char *tmp = xmalloc(strlen(argv[1]) + 2); + tmp[0] = '-'; + strcpy(tmp + 1, argv[1]); + argv[1] = tmp; + } + if (argc < 2) { show_usage(); } -- 2.25.1