summaryrefslogtreecommitdiff
path: root/archival/ar.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-04 14:30:37 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-04 14:30:37 +0100
commit40e5a30b66b51440f92826683c833ae23765390a (patch)
tree9ef02ecdcef5c63acfb633a8ed75fcc10ea642c7 /archival/ar.c
parent2ec91aead52d6ea6a42420005119ebb281a76cdc (diff)
downloadbusybox-w32-40e5a30b66b51440f92826683c833ae23765390a.tar.gz
busybox-w32-40e5a30b66b51440f92826683c833ae23765390a.tar.bz2
busybox-w32-40e5a30b66b51440f92826683c833ae23765390a.zip
ar: fix two bugs, one added by prev comment and other we SEGV with no params
cpio: use optind less function old new delta ar_main 189 184 -5 cpio_main 549 533 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-21) Total: -21 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/ar.c')
-rw-r--r--archival/ar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archival/ar.c b/archival/ar.c
index 1b43502ca..4f21bf82f 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -49,7 +49,7 @@ int ar_main(int argc UNUSED_PARAM, char **argv)
49 archive_handle = init_handle(); 49 archive_handle = init_handle();
50 50
51 /* Prepend '-' to the first argument if required */ 51 /* Prepend '-' to the first argument if required */
52 opt_complementary = "--:p:t:x:-1:p--tx:t--px:x--pt"; 52 opt_complementary = "--:-1:p:t:x:-1:p--tx:t--px:x--pt";
53 opt = getopt32(argv, "ptxovcr"); 53 opt = getopt32(argv, "ptxovcr");
54 argv += optind; 54 argv += optind;
55 55
@@ -75,7 +75,7 @@ int ar_main(int argc UNUSED_PARAM, char **argv)
75 bb_error_msg_and_die(msg_unsupported_err, "insertion"); 75 bb_error_msg_and_die(msg_unsupported_err, "insertion");
76 } 76 }
77 77
78 archive_handle->src_fd = xopen(argv[optind++], O_RDONLY); 78 archive_handle->src_fd = xopen(*argv++, O_RDONLY);
79 79
80 while (*argv) { 80 while (*argv) {
81 archive_handle->filter = filter_accept_list; 81 archive_handle->filter = filter_accept_list;