aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-15 22:05:07 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-15 22:05:07 +0100
commita40f0624db4c9490d46f116c4c4635dfa68e070c (patch)
tree6495c54fab2be22802c6befc9d5c8ea01807a60c /libbb
parent662078f9fd41efe422d7abc0aea1395c27c61ddd (diff)
downloadbusybox-w32-a40f0624db4c9490d46f116c4c4635dfa68e070c.tar.gz
busybox-w32-a40f0624db4c9490d46f116c4c4635dfa68e070c.tar.bz2
busybox-w32-a40f0624db4c9490d46f116c4c4635dfa68e070c.zip
cp: fix -H handling
function old new delta copy_file 1495 1518 +23 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/copy_file.c4
1 files changed, 2 insertions, 2 deletions
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)
83 signed char ovr; 83 signed char ovr;
84 84
85/* Inverse of cp -d ("cp without -d") */ 85/* Inverse of cp -d ("cp without -d") */
86#define FLAGS_DEREF (flags & FILEUTILS_DEREFERENCE) 86#define FLAGS_DEREF (flags & (FILEUTILS_DEREFERENCE + FILEUTILS_DEREFERENCE_L0))
87 87
88 if ((FLAGS_DEREF ? stat : lstat)(source, &source_stat) < 0) { 88 if ((FLAGS_DEREF ? stat : lstat)(source, &source_stat) < 0) {
89 /* This may be a dangling symlink. 89 /* This may be a dangling symlink.
@@ -194,7 +194,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
194 if (new_source == NULL) 194 if (new_source == NULL)
195 continue; 195 continue;
196 new_dest = concat_path_file(dest, d->d_name); 196 new_dest = concat_path_file(dest, d->d_name);
197 if (copy_file(new_source, new_dest, flags) < 0) 197 if (copy_file(new_source, new_dest, flags & ~FILEUTILS_DEREFERENCE_L0) < 0)
198 retval = -1; 198 retval = -1;
199 free(new_source); 199 free(new_source);
200 free(new_dest); 200 free(new_dest);