← Commit list

934805aec

Glenn L McGrath
Glenn L McGrath
2002-10-18
FAILED Duration: 6s

Subject

Put bac kthe code that handles cases where a '-' wasnt specified prior to the options.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/tar.c+8 -0
@@ -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();
}