src: optimize preserve_link: only if the file has actual link-count >= 2

This commit is contained in:
Markus F.X.J. Oberhumer
2023-09-05 05:50:47 +02:00
parent 4f6320d3aa
commit 30fcca4b64
2 changed files with 40 additions and 15 deletions
+2 -1
View File
@@ -179,7 +179,6 @@ static void check_and_update_options(int i, int argc) {
opt->overlay = opt->COPY_OVERLAY;
check_not_both(opt->exact, opt->overlay == opt->STRIP_OVERLAY, "--exact", "--overlay=strip");
check_not_both(opt->force_overwrite, opt->preserve_link, "--force-overwrite", "--link");
// set default backup option
if (opt->backup < 0)
@@ -199,6 +198,8 @@ static void check_and_update_options(int i, int argc) {
e_usage();
}
}
check_not_both(opt->force_overwrite, opt->preserve_link, "--force-overwrite", "--link");
check_not_both(opt->to_stdout, opt->preserve_link, "--stdout", "--link");
#if defined(__unix__) && !defined(__MSYS2__)
#else