diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 1999-12-29 02:36:29 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 1999-12-29 02:36:29 +0000 |
commit | b075e176c84bb3a5518bbabc5172212886a763b5 (patch) | |
tree | 0eb9f4d1d08bde592fc79ef034990fd5c0788e25 /cp.c | |
parent | 44f4e93332fd720f2962fc4189a710c30a5cb7f6 (diff) | |
download | busybox-w32-b075e176c84bb3a5518bbabc5172212886a763b5.tar.gz busybox-w32-b075e176c84bb3a5518bbabc5172212886a763b5.tar.bz2 busybox-w32-b075e176c84bb3a5518bbabc5172212886a763b5.zip |
Fixed mv so it now does the right thing (same method used in cp). Removed
some cruft from cp.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@268 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'cp.c')
-rw-r--r-- | cp.c | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -43,7 +43,6 @@ static int preserveFlag = FALSE; | |||
43 | static const char *srcName; | 43 | static const char *srcName; |
44 | static const char *destName; | 44 | static const char *destName; |
45 | static int destDirFlag = FALSE; | 45 | static int destDirFlag = FALSE; |
46 | static int destExistsFlag = FALSE; | ||
47 | static int srcDirFlag = FALSE; | 46 | static int srcDirFlag = FALSE; |
48 | 47 | ||
49 | static int fileAction(const char *fileName, struct stat* statbuf) | 48 | static int fileAction(const char *fileName, struct stat* statbuf) |
@@ -71,8 +70,6 @@ static int fileAction(const char *fileName, struct stat* statbuf) | |||
71 | 70 | ||
72 | extern int cp_main(int argc, char **argv) | 71 | extern int cp_main(int argc, char **argv) |
73 | { | 72 | { |
74 | struct stat statBuf; | ||
75 | |||
76 | if (argc < 3) { | 73 | if (argc < 3) { |
77 | usage (cp_usage); | 74 | usage (cp_usage); |
78 | } | 75 | } |
@@ -106,11 +103,7 @@ extern int cp_main(int argc, char **argv) | |||
106 | 103 | ||
107 | 104 | ||
108 | destName = argv[argc - 1]; | 105 | destName = argv[argc - 1]; |
109 | if (stat(destName, &statBuf) >= 0) { | 106 | destDirFlag = isDirectory(destName); |
110 | destExistsFlag = TRUE; | ||
111 | if (S_ISDIR(statBuf.st_mode)) | ||
112 | destDirFlag = TRUE; | ||
113 | } | ||
114 | 107 | ||
115 | if ((argc > 3) && destDirFlag==FALSE) { | 108 | if ((argc > 3) && destDirFlag==FALSE) { |
116 | fprintf(stderr, "%s: not a directory\n", destName); | 109 | fprintf(stderr, "%s: not a directory\n", destName); |