summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-05-10 07:35:43 +0000
committerJim Meyering <jim@meyering.net>2005-05-10 07:35:43 +0000
commit6a235271149b854be8ca8eb3d15a528e05957fbe (patch)
tree539fdf62bd140b60a484c93634c60d218c4df846 /src
parent6f1c1df83d02d6c48a3f1f96300b564655d05550 (diff)
downloadcoreutils-6a235271149b854be8ca8eb3d15a528e05957fbe.tar.xz
(abandon_move): Remove erroneous UNWRITABLE check.
This makes `mv -i --reply=no f1 f2' work as expected (in not performing the move operation). But note that specifying `-i' after `--reply=no' does *not* work. Tiny patch from Vlada Macek.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/copy.c b/src/copy.c
index 9f9856aa9..10fe90454 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -798,8 +798,8 @@ record_file (Hash_table *ht, char const *filename,
/* When effecting a move (e.g., for mv(1)), and given the name DST_PATH
of the destination and a corresponding stat buffer, DST_SB, return
- true if the logical `move' operation should not proceed.
- Return true if it may proceed.
+ true if the logical `move' operation should _not_ proceed.
+ Otherwise, return false.
Depending on options specified in X, this code may issue an
interactive prompt asking whether it's ok to overwrite DST_PATH. */
static bool
@@ -808,8 +808,7 @@ abandon_move (const struct cp_options *x,
struct stat const *dst_sb)
{
assert (x->move_mode);
- return ((x->interactive == I_ALWAYS_NO
- && UNWRITABLE (dst_path, dst_sb->st_mode))
+ return (x->interactive == I_ALWAYS_NO
|| ((x->interactive == I_ASK_USER
|| (x->interactive == I_UNSPECIFIED
&& x->stdin_tty