aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/cp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/toys/cp.c b/toys/cp.c
index 81a1e418..04c6369b 100644
--- a/toys/cp.c
+++ b/toys/cp.c
@@ -87,6 +87,7 @@ void cp_file(char *src, char *dst, struct stat *srcst)
// filehandle to them? O_NOFOLLOW causes the open to fail.
if (!link || symlink(link, dst)) perror_msg("link '%s'", dst);
free(link);
+ return;
} else if (toys.optflags & FLAG_l) {
if (link(src, dst)) perror_msg("link '%s'");
return;