aboutsummaryrefslogtreecommitdiff
path: root/cp.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-10-18 19:02:32 +0000
committerEric Andersen <andersen@codepoet.org>1999-10-18 19:02:32 +0000
commitbed30e97005aca748a44806399c646633038daa8 (patch)
treecdba32234f059656b0279b324ae28c742692cd0c /cp.c
parent9b5871888989b16f94cbba5dd304ac444def3afd (diff)
downloadbusybox-w32-bed30e97005aca748a44806399c646633038daa8.tar.gz
busybox-w32-bed30e97005aca748a44806399c646633038daa8.tar.bz2
busybox-w32-bed30e97005aca748a44806399c646633038daa8.zip
More fixes
Diffstat (limited to 'cp.c')
-rw-r--r--cp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cp.c b/cp.c
index 4016fc760..c5e34d333 100644
--- a/cp.c
+++ b/cp.c
@@ -48,7 +48,7 @@ static int fileAction(const char *fileName, struct stat* statbuf)
48{ 48{
49 char newdestName[NAME_MAX]; 49 char newdestName[NAME_MAX];
50 strcpy(newdestName, destName); 50 strcpy(newdestName, destName);
51 if (dirFlag==TRUE && newdestName[strlen(newdestName)-1]!= '/' ) { 51 if (dirFlag==TRUE) {
52 strcat(newdestName, "/"); 52 strcat(newdestName, "/");
53 if ( skipName != NULL) 53 if ( skipName != NULL)
54 strcat(newdestName, strstr(fileName, skipName)); 54 strcat(newdestName, strstr(fileName, skipName));
@@ -104,10 +104,12 @@ extern int cp_main(int argc, char **argv)
104 while (argc-- > 1) { 104 while (argc-- > 1) {
105 srcName = *(argv++); 105 srcName = *(argv++);
106 skipName = strrchr(srcName, '/'); 106 skipName = strrchr(srcName, '/');
107 if (skipName) skipName++; 107 if (skipName)
108 if (recursiveAction(srcName, recursiveFlag, followLinks, 108 skipName++;
109 fileAction, fileAction) == FALSE) 109 if (recursiveAction(srcName, recursiveFlag, followLinks, FALSE,
110 fileAction, fileAction) == FALSE) {
110 exit( FALSE); 111 exit( FALSE);
112 }
111 } 113 }
112 exit( TRUE); 114 exit( TRUE);
113} 115}