summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorErik Andersen2000-05-20 00:40:08 +0000
committerErik Andersen2000-05-20 00:40:08 +0000
commit8ea7d8cdaf4a03cdc06abc8b752b589271140a88 (patch)
tree955fc9545f490ca39f0c24629316b7d328612802 /archival
parent330fd2b5767110f29544131d4c72c77e0506b6df (diff)
downloadbusybox-8ea7d8cdaf4a03cdc06abc8b752b589271140a88.zip
busybox-8ea7d8cdaf4a03cdc06abc8b752b589271140a88.tar.gz
First pass at fixing tar segfault, and more portability updates.
-Erik
Diffstat (limited to 'archival')
-rw-r--r--archival/tar.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/archival/tar.c b/archival/tar.c
index 6784d80..c5aad45 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -185,7 +185,7 @@ extern int tar_main(int argc, char **argv)
usage(tar_usage);
/* Parse any options */
- while (--argc > 0 && **(++argv) == '-') {
+ while (--argc > 0 && strspn(*(++argv), "-cxt") >0 ) {
stopIt=FALSE;
while (stopIt==FALSE && *(++(*argv))) {
switch (**argv) {
@@ -265,7 +265,8 @@ extern int tar_main(int argc, char **argv)
#else
exit(writeTarFile(tarName, tostdoutFlag, verboseFlag, argc, argv, excludeList));
#endif
- } else {
+ }
+ if (listFlag == TRUE || extractFlag == TRUE) {
exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, verboseFlag, excludeList));
}