aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-10-14 11:40:03 -0500
committerRob Landley <rob@landley.net>2014-10-14 11:40:03 -0500
commit1796626d9e7a4df3705ef83dbf278d248756692b (patch)
tree33870ef211305850e55ddfe2bc3debfd937ed1a7
parent3dfb15fdcc3a00ead6cf1b6f03e371c62ad7a6f5 (diff)
downloadtoybox-1796626d9e7a4df3705ef83dbf278d248756692b.tar.gz
Fix last night's mv commit (use dest, not source).
-rw-r--r--toys/posix/cp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index a30671f8..07a8f05b 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -319,10 +319,10 @@ void cp_main(void)
// Technically "is writeable" is more complicated (022 is not writeable
// by the owner, just everybody _else_) but I don't care.
- if (!stat(src, &st)
+ if (!stat(TT.destname, &st)
&& ((toys.optflags & FLAG_i) || !(st.st_mode & 0222)))
{
- fprintf(stderr, "%s: overwrite '%s'", toys.which->name, src);
+ fprintf(stderr, "%s: overwrite '%s'", toys.which->name, TT.destname);
if (!yesno("", 1)) rc = 0;
else unlink(src);
}