aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog6
-rw-r--r--archival/tar.c7
-rw-r--r--tar.c7
3 files changed, 10 insertions, 10 deletions
diff --git a/Changelog b/Changelog
index e9fbdd043..44bcd37ff 100644
--- a/Changelog
+++ b/Changelog
@@ -16,10 +16,8 @@
16 * Fixed ping warnings -- fix from Sascha Ziemann <szi@aibon.ping.de> 16 * Fixed ping warnings -- fix from Sascha Ziemann <szi@aibon.ping.de>
17 * Fixed update segfault 17 * Fixed update segfault
18 * Fixed mknod -- minor number was always 0 18 * Fixed mknod -- minor number was always 0
19 * Fixed tar option parsing. In an attempt to accomodate the whiners 19 * Fixed tar option parsing, so both "tar xvf foo.tar" and "tar -xvf foo.tar"
20 that wanted "tar cf foo.tar foo" (i.e. no "-" before options) 20 now work (i.e. no "-" before options) (this was very broken in 0.43).
21 I broke creation of tarballs. I reverted the change (so tar needs
22 the "-" for all options).
23 * Several contributions from Randolph Chung <tausq@debian.org>. 21 * Several contributions from Randolph Chung <tausq@debian.org>.
24 * cp/mv now accepts the -f flag 22 * cp/mv now accepts the -f flag
25 * tail can now accept -<num> commands (e.g. -10) for better 23 * tail can now accept -<num> commands (e.g. -10) for better
diff --git a/archival/tar.c b/archival/tar.c
index c5aad45d6..7d440f451 100644
--- a/archival/tar.c
+++ b/archival/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
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