summaryrefslogtreecommitdiff
path: root/coreutils/cp.c
diff options
context:
space:
mode:
authorErik Andersen1999-12-29 02:36:29 +0000
committerErik Andersen1999-12-29 02:36:29 +0000
commitf664c004db12cdb3e379c1745351e225c7b92de7 (patch)
tree0eb9f4d1d08bde592fc79ef034990fd5c0788e25 /coreutils/cp.c
parent2fe08c7afb3ddef42f304e78cb6edfa28e0741ef (diff)
downloadbusybox-f664c004db12cdb3e379c1745351e225c7b92de7.zip
busybox-f664c004db12cdb3e379c1745351e225c7b92de7.tar.gz
Fixed mv so it now does the right thing (same method used in cp). Removed
some cruft from cp. -Erik
Diffstat (limited to 'coreutils/cp.c')
-rw-r--r--coreutils/cp.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c
index 1e10f28..8346019 100644
--- a/coreutils/cp.c
+++ b/coreutils/cp.c
@@ -43,7 +43,6 @@ static int preserveFlag = FALSE;
static const char *srcName;
static const char *destName;
static int destDirFlag = FALSE;
-static int destExistsFlag = FALSE;
static int srcDirFlag = FALSE;
static int fileAction(const char *fileName, struct stat* statbuf)
@@ -71,8 +70,6 @@ static int fileAction(const char *fileName, struct stat* statbuf)
extern int cp_main(int argc, char **argv)
{
- struct stat statBuf;
-
if (argc < 3) {
usage (cp_usage);
}
@@ -106,11 +103,7 @@ extern int cp_main(int argc, char **argv)
destName = argv[argc - 1];
- if (stat(destName, &statBuf) >= 0) {
- destExistsFlag = TRUE;
- if (S_ISDIR(statBuf.st_mode))
- destDirFlag = TRUE;
- }
+ destDirFlag = isDirectory(destName);
if ((argc > 3) && destDirFlag==FALSE) {
fprintf(stderr, "%s: not a directory\n", destName);