]> git.ipfire.org Git - thirdparty/xz.git/commit
xz: Fix suffix check.
authorJia Tan <jiat0218@gmail.com>
Tue, 14 Nov 2023 12:27:04 +0000 (20:27 +0800)
committerJia Tan <jiat0218@gmail.com>
Fri, 22 Dec 2023 12:02:06 +0000 (20:02 +0800)
commit87c956d4c4604d30b01326ea88f6241ec44f5526
treed128876d46c42d10c79bb53c6d3f859fbbfcc9c9
parent84196e8c094402cb71b669fb9e984c56ebabb145
xz: Fix suffix check.

The suffix refactor done in 99575947a58a60416c570eb78038d18a1ea4cef4
had a small regression where raw format compression to standard out
failed if a suffix was not set. In this case, setting the suffix did
not make sense since a file is not created.

Now, xz should only fail when a suffix is not provided when it is
actually needed.

For instance:

    echo "foo" | xz --format=raw --lzma2 | wc -c

does not need a suffix check since it creates no files. But:

    xz --format=raw --lzma2 --suffix=.bar foo

Needs the suffix to be set since it must create foo.bar.
src/xz/args.c