From a40f0624db4c9490d46f116c4c4635dfa68e070c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 15 Jan 2010 22:05:07 +0100 Subject: cp: fix -H handling function old new delta copy_file 1495 1518 +23 Signed-off-by: Denys Vlasenko --- libbb/copy_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libbb') diff --git a/libbb/copy_file.c b/libbb/copy_file.c index 893b52ed5..6c64fab16 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c @@ -83,7 +83,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) signed char ovr; /* Inverse of cp -d ("cp without -d") */ -#define FLAGS_DEREF (flags & FILEUTILS_DEREFERENCE) +#define FLAGS_DEREF (flags & (FILEUTILS_DEREFERENCE + FILEUTILS_DEREFERENCE_L0)) if ((FLAGS_DEREF ? stat : lstat)(source, &source_stat) < 0) { /* This may be a dangling symlink. @@ -194,7 +194,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) if (new_source == NULL) continue; new_dest = concat_path_file(dest, d->d_name); - if (copy_file(new_source, new_dest, flags) < 0) + if (copy_file(new_source, new_dest, flags & ~FILEUTILS_DEREFERENCE_L0) < 0) retval = -1; free(new_source); free(new_dest); -- cgit v1.2.3