]> git.ipfire.org Git - thirdparty/zstd.git/commit
[zstdcli] Refuse to overwrite input file
authorNick Terrell <terrelln@fb.com>
Tue, 18 Dec 2018 23:29:54 +0000 (15:29 -0800)
committerNick Terrell <terrelln@fb.com>
Tue, 18 Dec 2018 23:29:54 +0000 (15:29 -0800)
commitcd2c8defad1986ae90ecfec10f3a4e5fe0899a2a
treec718490729bb44f26b05629d0b9466fc7a0ab0ce
parent517d8c984ce9b30792fe5b6c8c79547d3748f34d
[zstdcli] Refuse to overwrite input file

Compare the input and output files by their inode number and
refuse to open the output file if the input file is the same.

This doesn't work when (de)compressing multiple files to a single
file, but that is a very uncommon use case, mostly used for
benchmarking by me.

Fixes #1422.
programs/fileio.c
tests/playTests.sh