changeset 283:2134fa02ec00

We don't open a destination filehandle for symlinks, so xclose() would barf.
author Rob Landley <rob@landley.net>
date Wed, 09 Apr 2008 22:24:36 -0500
parents a08f1affe016
children 603275a05524
files toys/cp.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/toys/cp.c	Wed Apr 09 22:01:20 2008 -0500
+++ b/toys/cp.c	Wed Apr 09 22:24:36 2008 -0500
@@ -87,6 +87,7 @@
 		// 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;