summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-06-19 03:31:59 +0000
committerJim Meyering <jim@meyering.net>1996-06-19 03:31:59 +0000
commitec0f2c34d31c932700da58d1c7b26d6a2fd8819f (patch)
tree27fd501b9c73b80f2ed0ca0e000edf7ff4e6f34a /src
parente26d180b8cbd89a658818fd7ef36f0d546542fdd (diff)
downloadcoreutils-ec0f2c34d31c932700da58d1c7b26d6a2fd8819f.tar.xz
(decode_switches): Correct typo in error message:
enironment -> environment. From Santiago Vila Doncel <sanvila@unex.es>.
Diffstat (limited to 'src')
-rw-r--r--src/ln.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ln.c b/src/ln.c
index b24501e36..e36a3a537 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -165,7 +165,13 @@ do_link (const char *source, const char *dest)
&& lstat_status == 0
&& (!symlink || stat (source, &source_stats) == 0)
&& source_stats.st_dev == dest_stats.st_dev
- && source_stats.st_ino == dest_stats.st_ino)
+ && source_stats.st_ino == dest_stats.st_ino
+ /* The following is an attempt to detect reliably whether
+ removing DEST will also remove SOURCE. It is defeated
+ by an invocation like `ln -f foo ./foo' when foo has more
+ than one hard link. FIXME: if anyone can tell me how to
+ do this better (yet still reliably), please do. */
+ && (source_stats.st_nlink == 1 || STREQ (source, dest)))
{
error (0, 0, _("`%s' and `%s' are the same file"), source, dest);
return 1;