]> git.ipfire.org Git - thirdparty/coreutils.git/commit
cp,mv: ensure -i,f are not overridden by -u
authorPádraig Brady <P@draigBrady.com>
Sun, 12 May 2024 11:21:19 +0000 (12:21 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 6 Jan 2025 14:46:21 +0000 (14:46 +0000)
commita6ab944e19684d0ccd0568fa8c06f71921c1e6c3
tree92912397af0272f768adc641137452998c6868d8
parent55728961377715701c1c83c7ae94e60dc404a37e
cp,mv: ensure -i,f are not overridden by -u

Since coreutils 9.3 we had --update={all,older} override -i.
In coreutils 9.5 this was expanded to -u
(to make it consistent with --update=older).

This patch reinstates things so that -i combines with -u instead.
I.e. have -i be protective, rather than selective (like -u).

The -f option of mv is similarly adjusted in this patch,
so now --update does not override any of -f,-i,-n.

* NEWS: Mention the bug fix.
* src/cp.c (main): Don't have -u disable prompting.
* src/mv.c (main): Likewise.
* tests/cp/cp-i.sh: Add a test case for -i.
* tests/mv/update.sh: Likewise.
* tests/mv/i-3.sh. Add a test case for -f.
Fixes https://bugs.gnu.org/70887
NEWS
src/cp.c
src/mv.c
tests/cp/cp-i.sh
tests/mv/i-3.sh
tests/mv/update.sh