summaryrefslogtreecommitdiff
path: root/cp_mv.c
diff options
context:
space:
mode:
authorErik Andersen2000-05-10 05:05:45 +0000
committerErik Andersen2000-05-10 05:05:45 +0000
commit59b9e870243c56a9c5ec045a925e4e9b3f1f6c3c (patch)
tree8db9c40b68387c1017007f5265e45c2a66ccfb0d /cp_mv.c
parentac130e1dca289c431c43b6efee4b3d9f2b367c87 (diff)
downloadbusybox-59b9e870243c56a9c5ec045a925e4e9b3f1f6c3c.zip
busybox-59b9e870243c56a9c5ec045a925e4e9b3f1f6c3c.tar.gz
* cp -fa now works as expected for symlinks (it didn't before)
* zcat works again (wasn't working since option parsing was broken) * more doc updates/more support for BB_FEATURE_SIMPLE_HELP -Erik
Diffstat (limited to 'cp_mv.c')
-rw-r--r--cp_mv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cp_mv.c b/cp_mv.c
index ae35bca..ac1e71b 100644
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -70,6 +70,7 @@ static const char *cp_mv_usage[] = /* .rodata */
static int recursiveFlag;
static int followLinks;
static int preserveFlag;
+static int forceFlag;
static const char *baseSrcName;
static int srcDirFlag;
@@ -167,7 +168,7 @@ cp_mv_Action(const char *fileName, struct stat *statbuf, void* junk)
add_to_ino_dev_hashtable(statbuf, destName);
}
}
- return copyFile(fileName, destName, preserveFlag, followLinks);
+ return copyFile(fileName, destName, preserveFlag, followLinks, forceFlag);
}
static int
@@ -200,7 +201,7 @@ extern int cp_mv_main(int argc, char **argv)
argv++;
if (dz_i == is_cp) {
- recursiveFlag = preserveFlag = FALSE;
+ recursiveFlag = preserveFlag = forceFlag = FALSE;
followLinks = TRUE;
while (**argv == '-') {
while (*++(*argv)) {
@@ -220,7 +221,7 @@ extern int cp_mv_main(int argc, char **argv)
recursiveFlag = TRUE;
break;
case 'f':
- /* for compatibility; busybox cp/mv always does force */
+ forceFlag = TRUE;
break;
default:
usage(cp_mv_usage[is_cp]);