mirror of
git://git.suckless.org/sbase
synced 2024-12-22 23:13:44 +00:00
Only unlink the destination file if -f has been specified
This commit is contained in:
parent
0d0624b855
commit
a6be4e7a4c
@ -47,7 +47,7 @@ cp(const char *s1, const char *s2)
|
|||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
if (cp_dflag && S_ISLNK(st.st_mode)) {
|
if (cp_dflag && S_ISLNK(st.st_mode)) {
|
||||||
if (readlink(s1, buf, sizeof(buf) - 1) >= 0) {
|
if (readlink(s1, buf, sizeof(buf) - 1) >= 0) {
|
||||||
if (cp_fflag);
|
if (cp_fflag)
|
||||||
unlink(s2);
|
unlink(s2);
|
||||||
if (symlink(buf, s2) != 0) {
|
if (symlink(buf, s2) != 0) {
|
||||||
weprintf("%s: can't create '%s'\n", argv0, s2);
|
weprintf("%s: can't create '%s'\n", argv0, s2);
|
||||||
|
Loading…
Reference in New Issue
Block a user