From: Jim Meyering Date: Mon, 6 Aug 2001 17:29:15 +0000 (+0000) Subject: (copy_internal): Set *rename_succeeded, so that X-Git-Tag: TEXTUTILS-2_0_15~483 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=01f160092e3a67c6a87019d034ba5294279b14ae;p=thirdparty%2Fcoreutils.git (copy_internal): Set *rename_succeeded, so that the caller (mv) doesn't remove the source file. --- diff --git a/src/copy.c b/src/copy.c index bc4b41065c..1096fba237 100644 --- a/src/copy.c +++ b/src/copy.c @@ -653,7 +653,13 @@ copy_internal (const char *src_path, const char *dst_path, } if (x->update && MTIME_CMP (src_sb, dst_sb) <= 0) - return 0; + { + /* Pretend the rename succeeded, so the caller (mv) + doesn't end up removing the source file. */ + if (rename_succeeded) + *rename_succeeded = 1; + return 0; + } } if (!S_ISDIR (src_type) && x->interactive)