diff options
author | Tom Ivar Helbekkmo <tih@hamartun.priv.no> | 2021-03-06 10:09:53 +0100 |
---|---|---|
committer | Tom Ivar Helbekkmo <tih@hamartun.priv.no> | 2021-03-06 10:09:53 +0100 |
commit | 809c2e466faa4ec6e60c6bf3f9b2a95dd2f6e4fc (patch) | |
tree | 268be9758d15614b7d12f5f54ac708d719486e51 /cpio/cpio.c | |
parent | 0d2e5a0502100a83366d7a01e8c9962a19aa22e4 (diff) | |
download | libarchive-809c2e466faa4ec6e60c6bf3f9b2a95dd2f6e4fc.tar.gz |
fix output format handling and symlink detection for PWB
Diffstat (limited to 'cpio/cpio.c')
-rw-r--r-- | cpio/cpio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpio/cpio.c b/cpio/cpio.c index d80c7621..3c1caeea 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -194,7 +194,6 @@ main(int argc, char *argv[]) break; case '6': /* in/out: assume/create 6th edition (PWB) format */ cpio->option_pwb = 1; - cpio->format = "pwb"; break; case '7': /* out: create archive using 7th Edition binary format */ cpio->format = "bin"; @@ -407,9 +406,12 @@ main(int argc, char *argv[]) switch (cpio->mode) { case 'o': - if (cpio->format == NULL) - cpio->format = "cpio"; /* Default format */ - + if (cpio->format == NULL) { + if (cpio->option_pwb) + cpio->format = "pwb"; + else + cpio->format = "cpio"; + } mode_out(cpio); break; case 'i': |