summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-08-22 10:31:55 +0000
committerJim Meyering <jim@meyering.net>2005-08-22 10:31:55 +0000
commitb5e741091df258fe2487853b047891e11383896d (patch)
tree654128523f6e6afe565d2115ff1c7db77c15117e /src
parenta0037fae22000ebce1e0617960a6b013b2ef02e7 (diff)
downloadcoreutils-b5e741091df258fe2487853b047891e11383896d.tar.xz
(do_link): If ln is invoked with --interactive (-i),
encounters an existing destination file, and gets an affirmative response, then first try to unlink the destination file rather than simply failing. Suggestion from Karl Berry.
Diffstat (limited to 'src')
-rw-r--r--src/ln.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ln.c b/src/ln.c
index 9c370e496..5efb1d455 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -244,6 +244,7 @@ do_link (const char *source, const char *dest, bool dest_is_dir)
fprintf (stderr, _("%s: replace %s? "), program_name, quote (dest));
if (!yesno ())
return true;
+ remove_existing_files = true;
}
if (backup_type != no_backups)