projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46945ad
)
(copy_internal): Make it so `mv -f FILE FILE' does not remove FILE.
author
Jim Meyering
<jim@meyering.net>
Sun, 23 May 1999 14:52:32 +0000
(14:52 +0000)
committer
Jim Meyering
<jim@meyering.net>
Sun, 23 May 1999 14:52:32 +0000
(14:52 +0000)
Based on a patch from Chris Yeo.
src/copy.c
patch
|
blob
|
history
diff --git
a/src/copy.c
b/src/copy.c
index
fe68d49
..
9246aa0
100644
(file)
--- a/
src/copy.c
+++ b/
src/copy.c
@@
-568,6
+568,13
@@
copy_internal (const char *src_path, const char *dst_path,
}
else
{
+ if (SAME_INODE (src_sb, dst_sb))
+ {
+ error (0, 0, _("`%s' and `%s' are the same file"),
+ src_path, dst_path);
+ return 1;
+ }
+
if (unlink (dst_path) && errno != ENOENT)
{
error (0, errno, _("cannot remove old link to `%s'"),