summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-10-14 22:16:57 +0000
committerEric Andersen <andersen@codepoet.org>1999-10-14 22:16:57 +0000
commit3c163822d88105450806fdb6a29fdfc2511267d1 (patch)
tree4c67645bbc6677ad2217da3cdf6c0a748e0ca88d /coreutils
parent2c1030177e0a6f849ba557400e3e4867de455ce9 (diff)
downloadbusybox-w32-3c163822d88105450806fdb6a29fdfc2511267d1.tar.gz
busybox-w32-3c163822d88105450806fdb6a29fdfc2511267d1.tar.bz2
busybox-w32-3c163822d88105450806fdb6a29fdfc2511267d1.zip
Fixed cp -[aR] and some other stuf.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cp.c12
-rw-r--r--coreutils/ls.c4
2 files changed, 9 insertions, 7 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c
index 94b4ab024..6ca66e642 100644
--- a/coreutils/cp.c
+++ b/coreutils/cp.c
@@ -40,13 +40,14 @@ static int followLinks = FALSE;
40static int preserveFlag = FALSE; 40static int preserveFlag = FALSE;
41static const char *srcName; 41static const char *srcName;
42static const char *destName; 42static const char *destName;
43static const char *skipName;
43 44
44 45
45static int fileAction(const char *fileName) 46static int fileAction(const char *fileName)
46{ 47{
47 char newdestName[NAME_MAX]; 48 char newdestName[NAME_MAX];
48 strcpy(newdestName, destName); 49 strcpy(newdestName, destName);
49 strcat(newdestName, fileName+(strlen(srcName))); 50 strcat(newdestName, strstr(fileName, skipName));
50 return (copyFile(fileName, newdestName, preserveFlag, followLinks)); 51 return (copyFile(fileName, newdestName, preserveFlag, followLinks));
51} 52}
52 53
@@ -98,10 +99,13 @@ extern int cp_main(int argc, char **argv)
98 exit (FALSE); 99 exit (FALSE);
99 } 100 }
100 101
101 while (argc-- >= 2) { 102 while (argc-- > 1) {
102 srcName = *(argv++); 103 srcName = *(argv++);
103 exit( recursiveAction(srcName, recursiveFlag, followLinks, 104 skipName = strrchr(srcName, '/');
104 fileAction, fileAction)); 105 if (skipName) skipName++;
106 if (recursiveAction(srcName, recursiveFlag, followLinks,
107 fileAction, fileAction) == FALSE)
108 exit( FALSE);
105 } 109 }
106 exit( TRUE); 110 exit( TRUE);
107} 111}
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 7a1b0f3d0..50b983e24 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -179,15 +179,13 @@ int ls_main(int argc, char **argv)
179#define FEATURE_AUTOWIDTH /* calculate terminal & column widths */ 179#define FEATURE_AUTOWIDTH /* calculate terminal & column widths */
180#define FEATURE_FILETYPECHAR /* enable -p and -F */ 180#define FEATURE_FILETYPECHAR /* enable -p and -F */
181 181
182#undef OP_BUF_SIZE 1024 /* leave undefined for unbuffered output */
183
184#define TERMINAL_WIDTH 80 /* use 79 if your terminal has linefold bug */ 182#define TERMINAL_WIDTH 80 /* use 79 if your terminal has linefold bug */
185#define COLUMN_WIDTH 14 /* default if AUTOWIDTH not defined */ 183#define COLUMN_WIDTH 14 /* default if AUTOWIDTH not defined */
186#define COLUMN_GAP 2 /* includes the file type char, if present */ 184#define COLUMN_GAP 2 /* includes the file type char, if present */
185#define HAS_REWINDDIR
187 186
188/************************************************************************/ 187/************************************************************************/
189 188
190#define HAS_REWINDDIR
191 189
192#if 1 /* FIXME libc 6 */ 190#if 1 /* FIXME libc 6 */
193# include <linux/types.h> 191# include <linux/types.h>