]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(do_link): Don't require --force when target exists and
authorJim Meyering <jim@meyering.net>
Thu, 11 Dec 1997 08:40:10 +0000 (08:40 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 11 Dec 1997 08:40:10 +0000 (08:40 +0000)
using --backup.  This changes makes ln consistent with cp and mv in
this respect.  Suggestion from Eli Zaretskii.

src/ln.c

index b7a5208a9d464c2782527ae56d6758d6808d431e..6078f48d0efa3dbc1c1af20199af24802994a542 100644 (file)
--- a/src/ln.c
+++ b/src/ln.c
@@ -257,7 +257,7 @@ do_link (const char *source, const char *dest)
          if (!yesno ())
            return 0;
        }
-      else if (!remove_existing_files)
+      else if (!remove_existing_files && backup_type == none)
        {
          error (0, 0, _("%s: File exists"), dest);
          return 1;