From: Rob Landley Date: Tue, 14 Oct 2014 16:40:03 +0000 (-0500) Subject: Fix last night's mv commit (use dest, not source). X-Git-Tag: upstream/0.5.2~181 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1796626d9e7a4df3705ef83dbf278d248756692b;p=platform%2Fupstream%2Ftoybox.git Fix last night's mv commit (use dest, not source). --- diff --git a/toys/posix/cp.c b/toys/posix/cp.c index a30671f..07a8f05 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); }