From b7138e1052fd632ad86c3be44dfb1557d9eaa860 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 13 Jan 2001 15:48:32 +0000 Subject: [PATCH] (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. --- src/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.7.4