diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2001-04-12 15:48:02 +0400 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2001-04-12 15:48:02 +0400 |
commit | 6785b51280d6b0c00e964e1e9b24ff05d92f5bcc (patch) | |
tree | c9fbaf8bd615cb7871e16a5525f3223543fe69f5 /archival/dpkg_deb.c | |
parent | 359c1068719c295b25b2d8b81a6aded5aeb6e23d (diff) |
dpkg-deb -c works now
Diffstat (limited to 'archival/dpkg_deb.c')
-rw-r--r-- | archival/dpkg_deb.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c index fbdb14e26..6653f2a7c 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; |