The previous behaviour was to overwrite a symlink only when the new
destination did not exist, i.e. to avoid creating a symlink to an
existing file! It had not been documented and it seems
counter-intuitive to me. So the new behavior protects symlinks pointing
to existing targets from being changed.
Also update manpage to document this mode.
Do not make any changes.
.TP
.BR \-o , " \-\-no\-overwrite"
-Do not overwrite existing files.
+Do not overwrite existing files. When
+.BR \-\-symlink
+is active, do not overwrite symlinks pointing to existing targets.
.TP
.BR \-V , " \-\-version"
Display version information and exit.
if (string_replace(from, to, target, target, &newname))
ret = 0;
- if (ret == 1 && nooverwrite && lstat(newname, &sb) == 0) {
+ if (ret == 1 && nooverwrite && lstat(target, &sb) == 0) {
if (verbose)
- printf(_("Skipping existing link: `%s'\n"), newname);
+ printf(_("Skipping existing link: `%s'\n"), target);
ret = 0;
}