# HG changeset patch # User Rob Landley # Date 1413304803 18000 # Node ID fc2200f927af7199a9affa22eaae66ec48fd79c5 # Parent a8d9bf6ca8bd262c43607dd3fa032c68c326f173 Fix last night's mv commit (use dest, not source). diff -r a8d9bf6ca8bd -r fc2200f927af toys/posix/cp.c --- a/toys/posix/cp.c Tue Oct 14 00:01:22 2014 -0500 +++ b/toys/posix/cp.c Tue Oct 14 11:40:03 2014 -0500 @@ -319,10 +319,10 @@ // 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); }