aboutsummaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tar.c b/tar.c
index c5aad45d6..7d440f451 100644
--- a/tar.c
+++ b/tar.c
@@ -173,7 +173,7 @@ extern int tar_main(int argc, char **argv)
173#if defined BB_FEATURE_TAR_EXCLUDE 173#if defined BB_FEATURE_TAR_EXCLUDE
174 int excludeListSize=0; 174 int excludeListSize=0;
175#endif 175#endif
176 const char *tarName=NULL; 176 const char *tarName="-";
177 int listFlag = FALSE; 177 int listFlag = FALSE;
178 int extractFlag = FALSE; 178 int extractFlag = FALSE;
179 int createFlag = FALSE; 179 int createFlag = FALSE;
@@ -187,13 +187,13 @@ extern int tar_main(int argc, char **argv)
187 /* Parse any options */ 187 /* Parse any options */
188 while (--argc > 0 && strspn(*(++argv), "-cxt") >0 ) { 188 while (--argc > 0 && strspn(*(++argv), "-cxt") >0 ) {
189 stopIt=FALSE; 189 stopIt=FALSE;
190 while (stopIt==FALSE && *(++(*argv))) { 190 while (stopIt==FALSE && *argv && **argv) {
191 switch (**argv) { 191 switch (**argv) {
192 case 'f': 192 case 'f':
193 if (--argc == 0) { 193 if (--argc == 0) {
194 fatalError( "Option requires an argument: No file specified\n"); 194 fatalError( "Option requires an argument: No file specified\n");
195 } 195 }
196 if (tarName != NULL) 196 if (*tarName != '-')
197 fatalError( "Only one 'f' option allowed\n"); 197 fatalError( "Only one 'f' option allowed\n");
198 tarName = *(++argv); 198 tarName = *(++argv);
199 if (tarName == NULL) 199 if (tarName == NULL)
@@ -252,6 +252,7 @@ extern int tar_main(int argc, char **argv)
252 fatalError( "Unknown tar flag '%c'\n" 252 fatalError( "Unknown tar flag '%c'\n"
253 "Try `tar --help' for more information\n", **argv); 253 "Try `tar --help' for more information\n", **argv);
254 } 254 }
255 ++(*argv);
255 } 256 }
256 } 257 }
257 258