From f1f20b9306ed3658e9433e00e78f2ac640d0160d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sun, 30 Aug 2015 06:35:30 -0500 Subject: Fix mv on overwrite. We need to remove the destination, not the source, to be able to overwrite. --- toys/posix/cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix') diff --git a/toys/posix/cp.c b/toys/posix/cp.c index d5e92f20..5a55f40b 100644 --- a/toys/posix/cp.c +++ b/toys/posix/cp.c @@ -382,7 +382,7 @@ void cp_main(void) { fprintf(stderr, "%s: overwrite '%s'", toys.which->name, TT.destname); if (!yesno("", 1)) rc = 0; - else unlink(src); + else unlink(TT.destname); } } -- cgit v1.2.3