summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorGlenn L McGrath2001-04-12 11:48:02 +0000
committerGlenn L McGrath2001-04-12 11:48:02 +0000
commit6785b51280d6b0c00e964e1e9b24ff05d92f5bcc (patch)
treec9fbaf8bd615cb7871e16a5525f3223543fe69f5 /archival
parent359c1068719c295b25b2d8b81a6aded5aeb6e23d (diff)
downloadbusybox-6785b51280d6b0c00e964e1e9b24ff05d92f5bcc.zip
busybox-6785b51280d6b0c00e964e1e9b24ff05d92f5bcc.tar.gz
dpkg-deb -c works now
Diffstat (limited to 'archival')
-rw-r--r--archival/dpkg_deb.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index fbdb14e..6653f2a 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -20,7 +20,7 @@
extern int dpkg_deb_main(int argc, char **argv)
{
- char *target_dir = NULL;
+ char *target_dir;
int opt = 0;
int optflag = 0;
@@ -50,9 +50,10 @@ extern int dpkg_deb_main(int argc, char **argv)
}
}
- if (((optind + 1 ) > argc) || (optflag == 0)) {
+ if (optind == argc) {
show_usage();
}
+
switch (optflag) {
case (extract_control):
case (extract_extract):
@@ -60,13 +61,15 @@ extern int dpkg_deb_main(int argc, char **argv)
if ( (optind + 1) == argc ) {
target_dir = (char *) xmalloc(7);
strcpy(target_dir, "DEBIAN");
+ } else {
+ target_dir = (char *) xmalloc(strlen(argv[optind + 1]) + 1);
+ strcpy(target_dir, argv[optind + 1]);
}
break;
- default: {
- target_dir = (char *) xmalloc(strlen(argv[optind + 1]));
- strcpy(target_dir, argv[optind + 1]);
- }
+ default:
+ target_dir = NULL;
}
+
deb_extract(argv[optind], optflag, target_dir);
/* else if (optflag & dpkg_deb_info) {
extract_flag = TRUE;