From: Jim Meyering Date: Sat, 13 Jan 2001 15:48:32 +0000 (+0000) Subject: (same_file_ok): When moving a symlink onto itself, X-Git-Tag: FILEUTILS-4_0_36~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7138e1052fd632ad86c3be44dfb1557d9eaa860;p=platform%2Fupstream%2Fcoreutils.git (same_file_ok): When moving a symlink onto itself, don't remove the symlink. Reported by David Luyer as Debian bug#82089, via Michael Stone. --- diff --git a/src/copy.c b/src/copy.c index f07a9ea..b5e0989 100644 --- a/src/copy.c +++ b/src/copy.c @@ -424,7 +424,7 @@ same_file_ok (const char *src_path, const struct stat *src_sb, know this here IFF preserving symlinks (aka xstat == lstat), then it's ok. */ if (S_ISLNK (src_sb->st_mode) && S_ISLNK (dst_sb->st_mode)) - return 1; + return ! same_name (src_path, dst_path); src_sb_link = src_sb; dst_sb_link = dst_sb;