Fix an obscure option parsing bug.
diff --git a/tar.c b/tar.c
index ade77a5..6dcda53 100644
--- a/tar.c
+++ b/tar.c
@@ -149,6 +149,7 @@
int createFlag = FALSE;
int verboseFlag = FALSE;
int tostdoutFlag = FALSE;
+ int firstOpt = TRUE;
int stopIt;
@@ -156,7 +157,9 @@
usage(tar_usage);
/* do normal option parsing */
- while (--argc > 0 && strspn(*(++argv), "-cxt") >0 ) {
+ while (--argc > 0 && ((*argv && **(++argv) == '-') ||
+ (firstOpt==TRUE && strspn(*argv, "-cxt") ))) {
+ firstOpt=FALSE;
stopIt=FALSE;
while (stopIt==FALSE && *argv && **argv) {
switch (**argv) {