coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

`split` should refuse to overwrite the input file

Open sylvestre opened this issue 2 years ago • 2 comments

Using GNU, all these commands are failing:

#export C=./target/debug/coreutils
rm -f xaa in2 in3
seq 10 | tee exp-1 > xaa
ln -s xaa in2
ln xaa in3

$C split -C 6 xaa
$C split -C 6 in2
$C split -C 6 in3
$C split -C 6 - < xaa

=>

# GNU:
$C split -C 6 xaa
split: 'xaa' would overwrite input; aborting
$C split -C 6 in2
split: 'xaa' would overwrite input; aborting
$C split -C 6 in3
split: 'xaa' would overwrite input; aborting
$C split -C 6 - < xaa
split: 'xaa' would overwrite input; aborting

All these commands pass with our version. Test upstream: https://github.com/coreutils/coreutils/blob/master/tests/split/guard-input.sh

sylvestre avatar Jun 13 '22 20:06 sylvestre

Hi, can I work on this? @sylvestre

TheAlakazam avatar Jun 14 '22 17:06 TheAlakazam

@TheAlakazam Of course!

tertsdiepraam avatar Jun 14 '22 19:06 tertsdiepraam