]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(decode_switches): Correct typo in error message:
authorJim Meyering <jim@meyering.net>
Wed, 19 Jun 1996 03:31:59 +0000 (03:31 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 19 Jun 1996 03:31:59 +0000 (03:31 +0000)
enironment -> environment.  From Santiago Vila Doncel
<sanvila@unex.es>.

src/ln.c

index b24501e36c0d78f4a5e24bb88fc1662bbb71b0e3..e36a3a53758d28debadced92ad770a0cb2105724 100644 (file)
--- 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;