diff options
Diffstat (limited to '')
-rw-r--r-- | src/xz/suffix.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/xz/suffix.c b/src/xz/suffix.c index 09add381..a9cdbd8a 100644 --- a/src/xz/suffix.c +++ b/src/xz/suffix.c @@ -131,15 +131,7 @@ uncompressed_name(const char *src_name, const size_t src_len) const char *new_suffix = ""; size_t new_len = 0; - if (opt_format == FORMAT_RAW) { - // Don't check for known suffixes when --format=raw was used. - if (custom_suffix == NULL) { - message_error(_("%s: With --format=raw, " - "--suffix=.SUF is required unless " - "writing to stdout"), src_name); - return NULL; - } - } else { + if (opt_format != FORMAT_RAW) { for (size_t i = 0; i < ARRAY_SIZE(suffixes); ++i) { new_len = test_suffix(suffixes[i].compressed, src_name, src_len); @@ -262,15 +254,6 @@ compressed_name(const char *src_name, size_t src_len) } } - // TODO: Hmm, maybe it would be better to validate this in args.c, - // since the suffix handling when decoding is weird now. - if (opt_format == FORMAT_RAW && custom_suffix == NULL) { - message_error(_("%s: With --format=raw, " - "--suffix=.SUF is required unless " - "writing to stdout"), src_name); - return NULL; - } - const char *suffix = custom_suffix != NULL ? custom_suffix : suffixes[0]; size_t suffix_len = strlen(suffix); @@ -409,3 +392,10 @@ suffix_set(const char *suffix) custom_suffix = xstrdup(suffix); return; } + + +extern bool +suffix_is_set(void) +{ + return custom_suffix == NULL; +} |