aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/basename.c4
-rw-r--r--coreutils/cat.c4
-rw-r--r--coreutils/chgrp.c7
-rw-r--r--coreutils/chmod.c7
-rw-r--r--coreutils/chown.c7
-rw-r--r--coreutils/chroot.c7
-rw-r--r--coreutils/cmp.c4
-rw-r--r--coreutils/df.c12
-rw-r--r--coreutils/dirname.c4
-rw-r--r--coreutils/du.c15
-rw-r--r--coreutils/head.c5
-rw-r--r--coreutils/ln.c4
-rw-r--r--coreutils/ls.c116
-rw-r--r--coreutils/rmdir.c5
-rw-r--r--coreutils/sort.c14
-rw-r--r--coreutils/tail.c12
-rw-r--r--coreutils/tee.c3
-rw-r--r--coreutils/touch.c5
-rw-r--r--coreutils/tr.c10
-rw-r--r--coreutils/uniq.c5
-rw-r--r--coreutils/uuencode.c4
21 files changed, 121 insertions, 133 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c
index c15afd533..bdbcec17a 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -2,8 +2,8 @@
2/* 2/*
3 * Mini basename implementation for busybox 3 * Mini basename implementation for busybox
4 * 4 *
5 * Copyright (C) 1999,2000,2001 by Lineo, inc. 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/cat.c b/coreutils/cat.c
index aa8528d6a..820b6342e 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -2,8 +2,8 @@
2/* 2/*
3 * Mini Cat implementation for busybox 3 * Mini Cat implementation for busybox
4 * 4 *
5 * Copyright (C) 1999,2000,2001 by Lineo, inc. 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c
index fbc1036a8..43ffeb7e6 100644
--- a/coreutils/chgrp.c
+++ b/coreutils/chgrp.c
@@ -1,10 +1,9 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Mini chown/chmod/chgrp implementation for busybox 3 * Mini chgrp implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index 9139b3f4d..53230b568 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -1,10 +1,9 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Mini chown/chmod/chgrp implementation for busybox 3 * Mini chmod implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/chown.c b/coreutils/chown.c
index d1e52deda..c1b992c37 100644
--- a/coreutils/chown.c
+++ b/coreutils/chown.c
@@ -1,10 +1,9 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Mini chown/chmod/chgrp implementation for busybox 3 * Mini chown implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index de6a2ea50..ba3e5f864 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -2,9 +2,8 @@
2/* 2/*
3 * Mini chroot implementation for busybox 3 * Mini chroot implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -48,7 +47,7 @@ int chroot_main(int argc, char **argv)
48 prog = *argv; 47 prog = *argv;
49 execvp(*argv, argv); 48 execvp(*argv, argv);
50 } else { 49 } else {
51#if defined shell_main && defined BB_FEATURE_SH_STANDALONE_SHELL 50#if defined shell_main && defined CONFIG_FEATURE_SH_STANDALONE_SHELL
52 char shell[] = "/bin/sh"; 51 char shell[] = "/bin/sh";
53 char *shell_argv[2] = { shell, NULL }; 52 char *shell_argv[2] = { shell, NULL };
54 applet_name = shell; 53 applet_name = shell;
diff --git a/coreutils/cmp.c b/coreutils/cmp.c
index 6d579461d..07bf3be92 100644
--- a/coreutils/cmp.c
+++ b/coreutils/cmp.c
@@ -2,9 +2,7 @@
2/* 2/*
3 * Mini cmp implementation for busybox 3 * Mini cmp implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 2000,2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
6 * Copyright (C) 1999,2000,2001 by Lineo, inc.
7 * Written by Matt Kraai <kraai@alumni.carnegiemellon.edu>
8 * 6 *
9 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/df.c b/coreutils/df.c
index 8cb13fa6d..0e9e5d61a 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -2,8 +2,8 @@
2/* 2/*
3 * Mini df implementation for busybox 3 * Mini df implementation for busybox
4 * 4 *
5 * Copyright (C) 1999,2000,2001 by Lineo, inc. 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * based on original code by (I think) Bruce Perens <bruce@pixar.com>. 7 * based on original code by (I think) Bruce Perens <bruce@pixar.com>.
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -31,7 +31,7 @@
31#include "busybox.h" 31#include "busybox.h"
32 32
33extern const char mtab_file[]; /* Defined in utility.c */ 33extern const char mtab_file[]; /* Defined in utility.c */
34#ifdef BB_FEATURE_HUMAN_READABLE 34#ifdef CONFIG_FEATURE_HUMAN_READABLE
35static unsigned long df_disp_hr = KILOBYTE; 35static unsigned long df_disp_hr = KILOBYTE;
36#endif 36#endif
37 37
@@ -61,7 +61,7 @@ static int do_df(char *device, const char *mount_point)
61 if(device==NULL) 61 if(device==NULL)
62 return FALSE; 62 return FALSE;
63 } 63 }
64#ifdef BB_FEATURE_HUMAN_READABLE 64#ifdef CONFIG_FEATURE_HUMAN_READABLE
65 printf("%-20s %9s ", device, 65 printf("%-20s %9s ", device,
66 make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr)); 66 make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr));
67 67
@@ -92,13 +92,13 @@ extern int df_main(int argc, char **argv)
92 char disp_units_hdr[80] = "1k-blocks"; /* default display is kilobytes */ 92 char disp_units_hdr[80] = "1k-blocks"; /* default display is kilobytes */
93 93
94 while ((opt = getopt(argc, argv, "k" 94 while ((opt = getopt(argc, argv, "k"
95#ifdef BB_FEATURE_HUMAN_READABLE 95#ifdef CONFIG_FEATURE_HUMAN_READABLE
96 "hm" 96 "hm"
97#endif 97#endif
98)) > 0) 98)) > 0)
99 { 99 {
100 switch (opt) { 100 switch (opt) {
101#ifdef BB_FEATURE_HUMAN_READABLE 101#ifdef CONFIG_FEATURE_HUMAN_READABLE
102 case 'h': 102 case 'h':
103 df_disp_hr = 0; 103 df_disp_hr = 0;
104 strcpy(disp_units_hdr, " Size"); 104 strcpy(disp_units_hdr, " Size");
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index b534e6950..387233789 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -2,8 +2,8 @@
2/* 2/*
3 * Mini dirname implementation for busybox 3 * Mini dirname implementation for busybox
4 * 4 *
5 * Copyright (C) 1999,2000,2001 by Lineo, inc. 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/du.c b/coreutils/du.c
index fb649aee5..c378837d0 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -2,9 +2,8 @@
2/* 2/*
3 * Mini du implementation for busybox 3 * Mini du implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000,2001 by Lineo, inc. and John Beppu
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
7 * Written by John Beppu <beppu@lineo.com>
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -33,7 +32,7 @@
33#include "busybox.h" 32#include "busybox.h"
34 33
35 34
36#ifdef BB_FEATURE_HUMAN_READABLE 35#ifdef CONFIG_FEATURE_HUMAN_READABLE
37static unsigned long disp_hr = KILOBYTE; 36static unsigned long disp_hr = KILOBYTE;
38#endif 37#endif
39 38
@@ -46,7 +45,7 @@ static Display *print;
46 45
47static void print_normal(long size, char *filename) 46static void print_normal(long size, char *filename)
48{ 47{
49#ifdef BB_FEATURE_HUMAN_READABLE 48#ifdef CONFIG_FEATURE_HUMAN_READABLE
50 printf("%s\t%s\n", make_human_readable_str(size<<10, 1, disp_hr), filename); 49 printf("%s\t%s\n", make_human_readable_str(size<<10, 1, disp_hr), filename);
51#else 50#else
52 printf("%ld\t%s\n", size, filename); 51 printf("%ld\t%s\n", size, filename);
@@ -207,7 +206,7 @@ int du_main(int argc, char **argv)
207 206
208 /* parse argv[] */ 207 /* parse argv[] */
209 while ((c = getopt(argc, argv, "sl" 208 while ((c = getopt(argc, argv, "sl"
210#ifdef BB_FEATURE_HUMAN_READABLE 209#ifdef CONFIG_FEATURE_HUMAN_READABLE
211"hm" 210"hm"
212#endif 211#endif
213"k")) != EOF) { 212"k")) != EOF) {
@@ -218,7 +217,7 @@ int du_main(int argc, char **argv)
218 case 'l': 217 case 'l':
219 count_hardlinks = 1; 218 count_hardlinks = 1;
220 break; 219 break;
221#ifdef BB_FEATURE_HUMAN_READABLE 220#ifdef CONFIG_FEATURE_HUMAN_READABLE
222 case 'h': disp_hr = 0; break; 221 case 'h': disp_hr = 0; break;
223 case 'm': disp_hr = MEGABYTE; break; 222 case 'm': disp_hr = MEGABYTE; break;
224#endif 223#endif
@@ -247,7 +246,7 @@ int du_main(int argc, char **argv)
247 return status; 246 return status;
248} 247}
249 248
250/* $Id: du.c,v 1.50 2001/06/30 17:54:20 andersen Exp $ */ 249/* $Id: du.c,v 1.51 2001/10/24 04:59:27 andersen Exp $ */
251/* 250/*
252Local Variables: 251Local Variables:
253c-file-style: "linux" 252c-file-style: "linux"
diff --git a/coreutils/head.c b/coreutils/head.c
index 688c250b1..4a1677146 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -2,9 +2,8 @@
2/* 2/*
3 * Mini head implementation for busybox 3 * Mini head implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999 by Lineo, inc. and John Beppu
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
7 * Written by John Beppu <beppu@lineo.com>
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/ln.c b/coreutils/ln.c
index 7412a86fd..213db9b72 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -2,8 +2,8 @@
2/* 2/*
3 * Mini ln implementation for busybox 3 * Mini ln implementation for busybox
4 * 4 *
5 * Copyright (C) 1999,2000,2001 by Lineo, inc. 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 8d0282dfe..672a3bb3c 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -65,7 +65,7 @@ enum {
65#include <sys/ioctl.h> 65#include <sys/ioctl.h>
66#include "busybox.h" 66#include "busybox.h"
67 67
68#ifdef BB_FEATURE_LS_TIMESTAMPS 68#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
69#include <time.h> 69#include <time.h>
70#endif 70#endif
71 71
@@ -108,7 +108,7 @@ STYLE_COLUMNS = 3 /* fill columns */
108#define DISP_RECURSIVE (1<<4) /* show directory and everything below it */ 108#define DISP_RECURSIVE (1<<4) /* show directory and everything below it */
109#define DISP_ROWS (1<<5) /* print across rows */ 109#define DISP_ROWS (1<<5) /* print across rows */
110 110
111#ifdef BB_FEATURE_LS_SORTFILES 111#ifdef CONFIG_FEATURE_LS_SORTFILES
112/* how will the files be sorted */ 112/* how will the files be sorted */
113static const int SORT_FORWARD = 0; /* sort in reverse order */ 113static const int SORT_FORWARD = 0; /* sort in reverse order */
114static const int SORT_REVERSE = 1; /* sort in reverse order */ 114static const int SORT_REVERSE = 1; /* sort in reverse order */
@@ -122,7 +122,7 @@ static const int SORT_EXT = 8; /* sort by file name extension */
122static const int SORT_DIR = 9; /* sort by file or directory */ 122static const int SORT_DIR = 9; /* sort by file or directory */
123#endif 123#endif
124 124
125#ifdef BB_FEATURE_LS_TIMESTAMPS 125#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
126/* which of the three times will be used */ 126/* which of the three times will be used */
127static const int TIME_MOD = 0; 127static const int TIME_MOD = 0;
128static const int TIME_CHANGE = 1; 128static const int TIME_CHANGE = 1;
@@ -142,7 +142,7 @@ static const int SPLIT_SUBDIR = 2;
142 142
143#define TYPEINDEX(mode) (((mode) >> 12) & 0x0f) 143#define TYPEINDEX(mode) (((mode) >> 12) & 0x0f)
144#define TYPECHAR(mode) ("0pcCd?bB-?l?s???" [TYPEINDEX(mode)]) 144#define TYPECHAR(mode) ("0pcCd?bB-?l?s???" [TYPEINDEX(mode)])
145#ifdef BB_FEATURE_LS_FILETYPES 145#ifdef CONFIG_FEATURE_LS_FILETYPES
146#define APPCHAR(mode) ("\0|\0\0/\0\0\0\0\0@\0=\0\0\0" [TYPEINDEX(mode)]) 146#define APPCHAR(mode) ("\0|\0\0/\0\0\0\0\0@\0=\0\0\0" [TYPEINDEX(mode)])
147#endif 147#endif
148 148
@@ -164,19 +164,19 @@ static int list_single(struct dnode *);
164static unsigned int disp_opts; 164static unsigned int disp_opts;
165static unsigned int style_fmt; 165static unsigned int style_fmt;
166static unsigned int list_fmt; 166static unsigned int list_fmt;
167#ifdef BB_FEATURE_LS_SORTFILES 167#ifdef CONFIG_FEATURE_LS_SORTFILES
168static unsigned int sort_opts; 168static unsigned int sort_opts;
169static unsigned int sort_order; 169static unsigned int sort_order;
170#endif 170#endif
171#ifdef BB_FEATURE_LS_TIMESTAMPS 171#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
172static unsigned int time_fmt; 172static unsigned int time_fmt;
173#endif 173#endif
174#ifdef BB_FEATURE_LS_FOLLOWLINKS 174#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
175static unsigned int follow_links=FALSE; 175static unsigned int follow_links=FALSE;
176#endif 176#endif
177 177
178static unsigned short column = 0; 178static unsigned short column = 0;
179#ifdef BB_FEATURE_AUTOWIDTH 179#ifdef CONFIG_FEATURE_AUTOWIDTH
180static unsigned short terminal_width = TERMINAL_WIDTH; 180static unsigned short terminal_width = TERMINAL_WIDTH;
181static unsigned short column_width = COLUMN_WIDTH; 181static unsigned short column_width = COLUMN_WIDTH;
182static unsigned short tabstops = COLUMN_GAP; 182static unsigned short tabstops = COLUMN_GAP;
@@ -186,13 +186,13 @@ static unsigned short column_width = COLUMN_WIDTH;
186 186
187static int status = EXIT_SUCCESS; 187static int status = EXIT_SUCCESS;
188 188
189#ifdef BB_FEATURE_HUMAN_READABLE 189#ifdef CONFIG_FEATURE_HUMAN_READABLE
190static unsigned long ls_disp_hr = 0; 190static unsigned long ls_disp_hr = 0;
191#endif 191#endif
192 192
193static int my_stat(struct dnode *cur) 193static int my_stat(struct dnode *cur)
194{ 194{
195#ifdef BB_FEATURE_LS_FOLLOWLINKS 195#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
196 if (follow_links == TRUE) { 196 if (follow_links == TRUE) {
197 if (stat(cur->fullname, &cur->dstat)) { 197 if (stat(cur->fullname, &cur->dstat)) {
198 perror_msg("%s", cur->fullname); 198 perror_msg("%s", cur->fullname);
@@ -222,7 +222,7 @@ static void newline(void)
222} 222}
223 223
224/*----------------------------------------------------------------------*/ 224/*----------------------------------------------------------------------*/
225#ifdef BB_FEATURE_LS_FILETYPES 225#ifdef CONFIG_FEATURE_LS_FILETYPES
226static char append_char(mode_t mode) 226static char append_char(mode_t mode)
227{ 227{
228 if ( !(list_fmt & LIST_FILETYPE)) 228 if ( !(list_fmt & LIST_FILETYPE))
@@ -304,7 +304,7 @@ static struct dnode **dnalloc(int num)
304 return(p); 304 return(p);
305} 305}
306 306
307#ifdef BB_FEATURE_LS_RECURSIVE 307#ifdef CONFIG_FEATURE_LS_RECURSIVE
308static void dfree(struct dnode **dnp) 308static void dfree(struct dnode **dnp)
309{ 309{
310 struct dnode *cur, *next; 310 struct dnode *cur, *next;
@@ -361,7 +361,7 @@ static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
361} 361}
362 362
363/*----------------------------------------------------------------------*/ 363/*----------------------------------------------------------------------*/
364#ifdef BB_FEATURE_LS_SORTFILES 364#ifdef CONFIG_FEATURE_LS_SORTFILES
365static int sortcmp(struct dnode *d1, struct dnode *d2) 365static int sortcmp(struct dnode *d1, struct dnode *d2)
366{ 366{
367 int cmp, dif; 367 int cmp, dif;
@@ -426,13 +426,13 @@ static void shellsort(struct dnode **dn, int size)
426static void showfiles(struct dnode **dn, int nfiles) 426static void showfiles(struct dnode **dn, int nfiles)
427{ 427{
428 int i, ncols, nrows, row, nc; 428 int i, ncols, nrows, row, nc;
429#ifdef BB_FEATURE_AUTOWIDTH 429#ifdef CONFIG_FEATURE_AUTOWIDTH
430 int len; 430 int len;
431#endif 431#endif
432 432
433 if(dn==NULL || nfiles < 1) return; 433 if(dn==NULL || nfiles < 1) return;
434 434
435#ifdef BB_FEATURE_AUTOWIDTH 435#ifdef CONFIG_FEATURE_AUTOWIDTH
436 /* find the longest file name- use that as the column width */ 436 /* find the longest file name- use that as the column width */
437 column_width= 0; 437 column_width= 0;
438 for (i=0; i<nfiles; i++) { 438 for (i=0; i<nfiles; i++) {
@@ -488,7 +488,7 @@ static void showdirs(struct dnode **dn, int ndirs)
488{ 488{
489 int i, nfiles; 489 int i, nfiles;
490 struct dnode **subdnp; 490 struct dnode **subdnp;
491#ifdef BB_FEATURE_LS_RECURSIVE 491#ifdef CONFIG_FEATURE_LS_RECURSIVE
492 int dndirs; 492 int dndirs;
493 struct dnode **dnd; 493 struct dnode **dnd;
494#endif 494#endif
@@ -503,17 +503,17 @@ static void showdirs(struct dnode **dn, int ndirs)
503 nfiles= countfiles(subdnp); 503 nfiles= countfiles(subdnp);
504 if (nfiles > 0) { 504 if (nfiles > 0) {
505 /* list all files at this level */ 505 /* list all files at this level */
506#ifdef BB_FEATURE_LS_SORTFILES 506#ifdef CONFIG_FEATURE_LS_SORTFILES
507 shellsort(subdnp, nfiles); 507 shellsort(subdnp, nfiles);
508#endif 508#endif
509 showfiles(subdnp, nfiles); 509 showfiles(subdnp, nfiles);
510#ifdef BB_FEATURE_LS_RECURSIVE 510#ifdef CONFIG_FEATURE_LS_RECURSIVE
511 if (disp_opts & DISP_RECURSIVE) { 511 if (disp_opts & DISP_RECURSIVE) {
512 /* recursive- list the sub-dirs */ 512 /* recursive- list the sub-dirs */
513 dnd= splitdnarray(subdnp, nfiles, SPLIT_SUBDIR); 513 dnd= splitdnarray(subdnp, nfiles, SPLIT_SUBDIR);
514 dndirs= countsubdirs(subdnp, nfiles); 514 dndirs= countsubdirs(subdnp, nfiles);
515 if (dndirs > 0) { 515 if (dndirs > 0) {
516#ifdef BB_FEATURE_LS_SORTFILES 516#ifdef CONFIG_FEATURE_LS_SORTFILES
517 shellsort(dnd, dndirs); 517 shellsort(dnd, dndirs);
518#endif 518#endif
519 showdirs(dnd, dndirs); 519 showdirs(dnd, dndirs);
@@ -582,26 +582,26 @@ static int list_single(struct dnode *dn)
582{ 582{
583 int i; 583 int i;
584 char scratch[BUFSIZ + 1]; 584 char scratch[BUFSIZ + 1];
585#ifdef BB_FEATURE_LS_TIMESTAMPS 585#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
586 char *filetime; 586 char *filetime;
587 time_t ttime, age; 587 time_t ttime, age;
588#endif 588#endif
589#if defined (BB_FEATURE_LS_FILETYPES) 589#if defined (CONFIG_FEATURE_LS_FILETYPES)
590 struct stat info; 590 struct stat info;
591#endif 591#endif
592#ifdef BB_FEATURE_LS_FILETYPES 592#ifdef CONFIG_FEATURE_LS_FILETYPES
593 char append; 593 char append;
594#endif 594#endif
595 595
596 if (dn==NULL || dn->fullname==NULL) return(0); 596 if (dn==NULL || dn->fullname==NULL) return(0);
597 597
598#ifdef BB_FEATURE_LS_TIMESTAMPS 598#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
599 ttime= dn->dstat.st_mtime; /* the default time */ 599 ttime= dn->dstat.st_mtime; /* the default time */
600 if (time_fmt & TIME_ACCESS) ttime= dn->dstat.st_atime; 600 if (time_fmt & TIME_ACCESS) ttime= dn->dstat.st_atime;
601 if (time_fmt & TIME_CHANGE) ttime= dn->dstat.st_ctime; 601 if (time_fmt & TIME_CHANGE) ttime= dn->dstat.st_ctime;
602 filetime= ctime(&ttime); 602 filetime= ctime(&ttime);
603#endif 603#endif
604#ifdef BB_FEATURE_LS_FILETYPES 604#ifdef CONFIG_FEATURE_LS_FILETYPES
605 append = append_char(dn->dstat.st_mode); 605 append = append_char(dn->dstat.st_mode);
606#endif 606#endif
607 607
@@ -612,7 +612,7 @@ static int list_single(struct dnode *dn)
612 column += 8; 612 column += 8;
613 break; 613 break;
614 case LIST_BLOCKS: 614 case LIST_BLOCKS:
615#ifdef BB_FEATURE_HUMAN_READABLE 615#ifdef CONFIG_FEATURE_HUMAN_READABLE
616 fprintf(stdout, "%6s ", make_human_readable_str(dn->dstat.st_blocks>>1, 616 fprintf(stdout, "%6s ", make_human_readable_str(dn->dstat.st_blocks>>1,
617 KILOBYTE, (ls_disp_hr==TRUE)? 0: KILOBYTE)); 617 KILOBYTE, (ls_disp_hr==TRUE)? 0: KILOBYTE));
618#else 618#else
@@ -633,7 +633,7 @@ static int list_single(struct dnode *dn)
633 column += 10; 633 column += 10;
634 break; 634 break;
635 case LIST_ID_NAME: 635 case LIST_ID_NAME:
636#ifdef BB_FEATURE_LS_USERNAME 636#ifdef CONFIG_FEATURE_LS_USERNAME
637 my_getpwuid(scratch, dn->dstat.st_uid); 637 my_getpwuid(scratch, dn->dstat.st_uid);
638 printf("%-8.8s ", scratch); 638 printf("%-8.8s ", scratch);
639 my_getgrgid(scratch, dn->dstat.st_gid); 639 my_getgrgid(scratch, dn->dstat.st_gid);
@@ -650,7 +650,7 @@ static int list_single(struct dnode *dn)
650 if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { 650 if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) {
651 printf("%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); 651 printf("%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev));
652 } else { 652 } else {
653#ifdef BB_FEATURE_HUMAN_READABLE 653#ifdef CONFIG_FEATURE_HUMAN_READABLE
654 if (ls_disp_hr==TRUE) { 654 if (ls_disp_hr==TRUE) {
655 fprintf(stdout, "%8s ", make_human_readable_str(dn->dstat.st_size, 1, 0)); 655 fprintf(stdout, "%8s ", make_human_readable_str(dn->dstat.st_size, 1, 0));
656 } else 656 } else
@@ -665,7 +665,7 @@ static int list_single(struct dnode *dn)
665 } 665 }
666 column += 10; 666 column += 10;
667 break; 667 break;
668#ifdef BB_FEATURE_LS_TIMESTAMPS 668#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
669 case LIST_FULLTIME: 669 case LIST_FULLTIME:
670 case LIST_DATE_TIME: 670 case LIST_DATE_TIME:
671 if (list_fmt & LIST_FULLTIME) { 671 if (list_fmt & LIST_FULLTIME) {
@@ -693,7 +693,7 @@ static int list_single(struct dnode *dn)
693 char *lpath = xreadlink(dn->fullname); 693 char *lpath = xreadlink(dn->fullname);
694 if (lpath) { 694 if (lpath) {
695 printf(" -> %s", lpath); 695 printf(" -> %s", lpath);
696#ifdef BB_FEATURE_LS_FILETYPES 696#ifdef CONFIG_FEATURE_LS_FILETYPES
697 if (!stat(dn->fullname, &info)) { 697 if (!stat(dn->fullname, &info)) {
698 append = append_char(info.st_mode); 698 append = append_char(info.st_mode);
699 } 699 }
@@ -703,7 +703,7 @@ static int list_single(struct dnode *dn)
703 } 703 }
704 } 704 }
705 break; 705 break;
706#ifdef BB_FEATURE_LS_FILETYPES 706#ifdef CONFIG_FEATURE_LS_FILETYPES
707 case LIST_FILETYPE: 707 case LIST_FILETYPE:
708 if (append != '\0') { 708 if (append != '\0') {
709 printf("%1c", append); 709 printf("%1c", append);
@@ -727,21 +727,21 @@ extern int ls_main(int argc, char **argv)
727 int opt; 727 int opt;
728 int oi, ac; 728 int oi, ac;
729 char **av; 729 char **av;
730#ifdef BB_FEATURE_AUTOWIDTH 730#ifdef CONFIG_FEATURE_AUTOWIDTH
731 struct winsize win = { 0, 0, 0, 0 }; 731 struct winsize win = { 0, 0, 0, 0 };
732#endif 732#endif
733 733
734 disp_opts= DISP_NORMAL; 734 disp_opts= DISP_NORMAL;
735 style_fmt= STYLE_AUTO; 735 style_fmt= STYLE_AUTO;
736 list_fmt= LIST_SHORT; 736 list_fmt= LIST_SHORT;
737#ifdef BB_FEATURE_LS_SORTFILES 737#ifdef CONFIG_FEATURE_LS_SORTFILES
738 sort_opts= SORT_NAME; 738 sort_opts= SORT_NAME;
739 sort_order= SORT_FORWARD; 739 sort_order= SORT_FORWARD;
740#endif 740#endif
741#ifdef BB_FEATURE_LS_TIMESTAMPS 741#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
742 time_fmt= TIME_MOD; 742 time_fmt= TIME_MOD;
743#endif 743#endif
744#ifdef BB_FEATURE_AUTOWIDTH 744#ifdef CONFIG_FEATURE_AUTOWIDTH
745 ioctl(fileno(stdout), TIOCGWINSZ, &win); 745 ioctl(fileno(stdout), TIOCGWINSZ, &win);
746 if (win.ws_row > 4) 746 if (win.ws_row > 4)
747 column_width = win.ws_row - 2; 747 column_width = win.ws_row - 2;
@@ -752,25 +752,25 @@ extern int ls_main(int argc, char **argv)
752 752
753 /* process options */ 753 /* process options */
754 while ((opt = getopt(argc, argv, "1AaCdgilnsx" 754 while ((opt = getopt(argc, argv, "1AaCdgilnsx"
755#ifdef BB_FEATURE_AUTOWIDTH 755#ifdef CONFIG_FEATURE_AUTOWIDTH
756"T:w:" 756"T:w:"
757#endif 757#endif
758#ifdef BB_FEATURE_LS_FILETYPES 758#ifdef CONFIG_FEATURE_LS_FILETYPES
759"Fp" 759"Fp"
760#endif 760#endif
761#ifdef BB_FEATURE_LS_RECURSIVE 761#ifdef CONFIG_FEATURE_LS_RECURSIVE
762"R" 762"R"
763#endif 763#endif
764#ifdef BB_FEATURE_LS_SORTFILES 764#ifdef CONFIG_FEATURE_LS_SORTFILES
765"rSvX" 765"rSvX"
766#endif 766#endif
767#ifdef BB_FEATURE_LS_TIMESTAMPS 767#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
768"cetu" 768"cetu"
769#endif 769#endif
770#ifdef BB_FEATURE_LS_FOLLOWLINKS 770#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
771"L" 771"L"
772#endif 772#endif
773#ifdef BB_FEATURE_HUMAN_READABLE 773#ifdef CONFIG_FEATURE_HUMAN_READABLE
774"h" 774"h"
775#endif 775#endif
776"k")) > 0) { 776"k")) > 0) {
@@ -785,54 +785,54 @@ extern int ls_main(int argc, char **argv)
785 case 'l': 785 case 'l':
786 style_fmt = STYLE_LONG; 786 style_fmt = STYLE_LONG;
787 list_fmt |= LIST_LONG; 787 list_fmt |= LIST_LONG;
788#ifdef BB_FEATURE_HUMAN_READABLE 788#ifdef CONFIG_FEATURE_HUMAN_READABLE
789 ls_disp_hr = FALSE; 789 ls_disp_hr = FALSE;
790#endif 790#endif
791 break; 791 break;
792 case 'n': list_fmt |= LIST_ID_NUMERIC; break; 792 case 'n': list_fmt |= LIST_ID_NUMERIC; break;
793 case 's': list_fmt |= LIST_BLOCKS; break; 793 case 's': list_fmt |= LIST_BLOCKS; break;
794 case 'x': disp_opts = DISP_ROWS; break; 794 case 'x': disp_opts = DISP_ROWS; break;
795#ifdef BB_FEATURE_LS_FILETYPES 795#ifdef CONFIG_FEATURE_LS_FILETYPES
796 case 'F': list_fmt |= LIST_FILETYPE | LIST_EXEC; break; 796 case 'F': list_fmt |= LIST_FILETYPE | LIST_EXEC; break;
797 case 'p': list_fmt |= LIST_FILETYPE; break; 797 case 'p': list_fmt |= LIST_FILETYPE; break;
798#endif 798#endif
799#ifdef BB_FEATURE_LS_RECURSIVE 799#ifdef CONFIG_FEATURE_LS_RECURSIVE
800 case 'R': disp_opts |= DISP_RECURSIVE; break; 800 case 'R': disp_opts |= DISP_RECURSIVE; break;
801#endif 801#endif
802#ifdef BB_FEATURE_LS_SORTFILES 802#ifdef CONFIG_FEATURE_LS_SORTFILES
803 case 'r': sort_order |= SORT_REVERSE; break; 803 case 'r': sort_order |= SORT_REVERSE; break;
804 case 'S': sort_opts= SORT_SIZE; break; 804 case 'S': sort_opts= SORT_SIZE; break;
805 case 'v': sort_opts= SORT_VERSION; break; 805 case 'v': sort_opts= SORT_VERSION; break;
806 case 'X': sort_opts= SORT_EXT; break; 806 case 'X': sort_opts= SORT_EXT; break;
807#endif 807#endif
808#ifdef BB_FEATURE_LS_TIMESTAMPS 808#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
809 case 'e': list_fmt |= LIST_FULLTIME; break; 809 case 'e': list_fmt |= LIST_FULLTIME; break;
810 case 'c': 810 case 'c':
811 time_fmt = TIME_CHANGE; 811 time_fmt = TIME_CHANGE;
812#ifdef BB_FEATURE_LS_SORTFILES 812#ifdef CONFIG_FEATURE_LS_SORTFILES
813 sort_opts= SORT_CTIME; 813 sort_opts= SORT_CTIME;
814#endif 814#endif
815 break; 815 break;
816 case 'u': 816 case 'u':
817 time_fmt = TIME_ACCESS; 817 time_fmt = TIME_ACCESS;
818#ifdef BB_FEATURE_LS_SORTFILES 818#ifdef CONFIG_FEATURE_LS_SORTFILES
819 sort_opts= SORT_ATIME; 819 sort_opts= SORT_ATIME;
820#endif 820#endif
821 break; 821 break;
822 case 't': 822 case 't':
823#ifdef BB_FEATURE_LS_SORTFILES 823#ifdef CONFIG_FEATURE_LS_SORTFILES
824 sort_opts= SORT_MTIME; 824 sort_opts= SORT_MTIME;
825#endif 825#endif
826 break; 826 break;
827#endif 827#endif
828#ifdef BB_FEATURE_LS_FOLLOWLINKS 828#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
829 case 'L': follow_links= TRUE; break; 829 case 'L': follow_links= TRUE; break;
830#endif 830#endif
831#ifdef BB_FEATURE_AUTOWIDTH 831#ifdef CONFIG_FEATURE_AUTOWIDTH
832 case 'T': tabstops= atoi(optarg); break; 832 case 'T': tabstops= atoi(optarg); break;
833 case 'w': terminal_width= atoi(optarg); break; 833 case 'w': terminal_width= atoi(optarg); break;
834#endif 834#endif
835#ifdef BB_FEATURE_HUMAN_READABLE 835#ifdef CONFIG_FEATURE_HUMAN_READABLE
836 case 'h': ls_disp_hr = TRUE; break; 836 case 'h': ls_disp_hr = TRUE; break;
837#endif 837#endif
838 case 'k': break; 838 case 'k': break;
@@ -842,17 +842,17 @@ extern int ls_main(int argc, char **argv)
842 } 842 }
843 843
844 /* sort out which command line options take precedence */ 844 /* sort out which command line options take precedence */
845#ifdef BB_FEATURE_LS_RECURSIVE 845#ifdef CONFIG_FEATURE_LS_RECURSIVE
846 if (disp_opts & DISP_NOLIST) 846 if (disp_opts & DISP_NOLIST)
847 disp_opts &= ~DISP_RECURSIVE; /* no recurse if listing only dir */ 847 disp_opts &= ~DISP_RECURSIVE; /* no recurse if listing only dir */
848#endif 848#endif
849#if defined (BB_FEATURE_LS_TIMESTAMPS) && defined (BB_FEATURE_LS_SORTFILES) 849#if defined (CONFIG_FEATURE_LS_TIMESTAMPS) && defined (CONFIG_FEATURE_LS_SORTFILES)
850 if (time_fmt & TIME_CHANGE) sort_opts= SORT_CTIME; 850 if (time_fmt & TIME_CHANGE) sort_opts= SORT_CTIME;
851 if (time_fmt & TIME_ACCESS) sort_opts= SORT_ATIME; 851 if (time_fmt & TIME_ACCESS) sort_opts= SORT_ATIME;
852#endif 852#endif
853 if (style_fmt != STYLE_LONG) 853 if (style_fmt != STYLE_LONG)
854 list_fmt &= ~LIST_ID_NUMERIC; /* numeric uid only for long list */ 854 list_fmt &= ~LIST_ID_NUMERIC; /* numeric uid only for long list */
855#ifdef BB_FEATURE_LS_USERNAME 855#ifdef CONFIG_FEATURE_LS_USERNAME
856 if (style_fmt == STYLE_LONG && (list_fmt & LIST_ID_NUMERIC)) 856 if (style_fmt == STYLE_LONG && (list_fmt & LIST_ID_NUMERIC))
857 list_fmt &= ~LIST_ID_NAME; /* don't list names if numeric uid */ 857 list_fmt &= ~LIST_ID_NAME; /* don't list names if numeric uid */
858#endif 858#endif
@@ -908,7 +908,7 @@ extern int ls_main(int argc, char **argv)
908 908
909 909
910 if (disp_opts & DISP_NOLIST) { 910 if (disp_opts & DISP_NOLIST) {
911#ifdef BB_FEATURE_LS_SORTFILES 911#ifdef CONFIG_FEATURE_LS_SORTFILES
912 shellsort(dnp, nfiles); 912 shellsort(dnp, nfiles);
913#endif 913#endif
914 if (nfiles > 0) showfiles(dnp, nfiles); 914 if (nfiles > 0) showfiles(dnp, nfiles);
@@ -918,13 +918,13 @@ extern int ls_main(int argc, char **argv)
918 dndirs= countdirs(dnp, nfiles); 918 dndirs= countdirs(dnp, nfiles);
919 dnfiles= nfiles - dndirs; 919 dnfiles= nfiles - dndirs;
920 if (dnfiles > 0) { 920 if (dnfiles > 0) {
921#ifdef BB_FEATURE_LS_SORTFILES 921#ifdef CONFIG_FEATURE_LS_SORTFILES
922 shellsort(dnf, dnfiles); 922 shellsort(dnf, dnfiles);
923#endif 923#endif
924 showfiles(dnf, dnfiles); 924 showfiles(dnf, dnfiles);
925 } 925 }
926 if (dndirs > 0) { 926 if (dndirs > 0) {
927#ifdef BB_FEATURE_LS_SORTFILES 927#ifdef CONFIG_FEATURE_LS_SORTFILES
928 shellsort(dnd, dndirs); 928 shellsort(dnd, dndirs);
929#endif 929#endif
930 showdirs(dnd, dndirs); 930 showdirs(dnd, dndirs);
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index cac27cac9..83b27c9bd 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -2,9 +2,8 @@
2/* 2/*
3 * Mini rmdir implementation for busybox 3 * Mini rmdir implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 4f4979cc5..fc12dfb01 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -43,10 +43,10 @@ int sort_main(int argc, char **argv)
43 char *line, **lines = NULL; 43 char *line, **lines = NULL;
44 int i, opt, nlines = 0; 44 int i, opt, nlines = 0;
45 int (*compare)(const void *, const void *) = compare_ascii; 45 int (*compare)(const void *, const void *) = compare_ascii;
46#ifdef BB_FEATURE_SORT_REVERSE 46#ifdef CONFIG_FEATURE_SORT_REVERSE
47 int reverse = FALSE; 47 int reverse = FALSE;
48#endif 48#endif
49#ifdef BB_FEATURE_SORT_UNIQUE 49#ifdef CONFIG_FEATURE_SORT_UNIQUE
50 int unique = FALSE; 50 int unique = FALSE;
51#endif 51#endif
52 52
@@ -55,12 +55,12 @@ int sort_main(int argc, char **argv)
55 case 'n': 55 case 'n':
56 compare = compare_numeric; 56 compare = compare_numeric;
57 break; 57 break;
58#ifdef BB_FEATURE_SORT_REVERSE 58#ifdef CONFIG_FEATURE_SORT_REVERSE
59 case 'r': 59 case 'r':
60 reverse = TRUE; 60 reverse = TRUE;
61 break; 61 break;
62#endif 62#endif
63#ifdef BB_FEATURE_SORT_UNIQUE 63#ifdef CONFIG_FEATURE_SORT_UNIQUE
64 case 'u': 64 case 'u':
65 unique = TRUE; 65 unique = TRUE;
66 break; 66 break;
@@ -88,17 +88,17 @@ int sort_main(int argc, char **argv)
88 qsort(lines, nlines, sizeof(char *), compare); 88 qsort(lines, nlines, sizeof(char *), compare);
89 89
90 /* print it */ 90 /* print it */
91#ifdef BB_FEATURE_SORT_REVERSE 91#ifdef CONFIG_FEATURE_SORT_REVERSE
92 if (reverse) { 92 if (reverse) {
93 for (i = --nlines; 0 <= i; i--) 93 for (i = --nlines; 0 <= i; i--)
94#ifdef BB_FEATURE_SORT_UNIQUE 94#ifdef CONFIG_FEATURE_SORT_UNIQUE
95 if((!unique) || (i == nlines) || (strcmp(lines[i + 1], lines[i]))) 95 if((!unique) || (i == nlines) || (strcmp(lines[i + 1], lines[i])))
96#endif 96#endif
97 puts(lines[i]); 97 puts(lines[i]);
98 } else 98 } else
99#endif 99#endif
100 for (i = 0; i < nlines; i++) 100 for (i = 0; i < nlines; i++)
101#ifdef BB_FEATURE_SORT_UNIQUE 101#ifdef CONFIG_FEATURE_SORT_UNIQUE
102 if((!unique) || (!i) || (strcmp(lines[i - 1], lines[i]))) 102 if((!unique) || (!i) || (strcmp(lines[i - 1], lines[i])))
103#endif 103#endif
104 puts(lines[i]); 104 puts(lines[i]);
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 5e5fbc14f..0c8dec26a 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -73,7 +73,7 @@ int tail_main(int argc, char **argv)
73 case 'f': 73 case 'f':
74 follow = 1; 74 follow = 1;
75 break; 75 break;
76#ifdef BB_FEATURE_FANCY_TAIL 76#ifdef CONFIG_FEATURE_FANCY_TAIL
77 case 'c': 77 case 'c':
78 units = BYTES; 78 units = BYTES;
79 /* FALLS THROUGH */ 79 /* FALLS THROUGH */
@@ -85,7 +85,7 @@ int tail_main(int argc, char **argv)
85 if (optarg[0] == '+') 85 if (optarg[0] == '+')
86 from_top = 1; 86 from_top = 1;
87 break; 87 break;
88#ifdef BB_FEATURE_FANCY_TAIL 88#ifdef CONFIG_FEATURE_FANCY_TAIL
89 case 'q': 89 case 'q':
90 hide_headers = 1; 90 hide_headers = 1;
91 break; 91 break;
@@ -118,7 +118,7 @@ int tail_main(int argc, char **argv)
118 } 118 }
119 } 119 }
120 120
121#ifdef BB_FEATURE_FANCY_TAIL 121#ifdef CONFIG_FEATURE_FANCY_TAIL
122 /* tail the files */ 122 /* tail the files */
123 if (!from_top && units == BYTES) 123 if (!from_top && units == BYTES)
124 tailbuf = xmalloc(count); 124 tailbuf = xmalloc(count);
@@ -136,7 +136,7 @@ int tail_main(int argc, char **argv)
136 printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]); 136 printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]);
137 while ((nread = safe_read(fds[i], buf, sizeof(buf))) > 0) { 137 while ((nread = safe_read(fds[i], buf, sizeof(buf))) > 0) {
138 if (from_top) { 138 if (from_top) {
139#ifdef BB_FEATURE_FANCY_TAIL 139#ifdef CONFIG_FEATURE_FANCY_TAIL
140 if (units == BYTES) { 140 if (units == BYTES) {
141 if (count - 1 <= seen) 141 if (count - 1 <= seen)
142 nwrite = nread; 142 nwrite = nread;
@@ -169,7 +169,7 @@ int tail_main(int argc, char **argv)
169 break; 169 break;
170 } 170 }
171 } else { 171 } else {
172#ifdef BB_FEATURE_FANCY_TAIL 172#ifdef CONFIG_FEATURE_FANCY_TAIL
173 if (units == BYTES) { 173 if (units == BYTES) {
174 if (nread < count) { 174 if (nread < count) {
175 memmove(tailbuf, tailbuf + nread, count - nread); 175 memmove(tailbuf, tailbuf + nread, count - nread);
@@ -203,7 +203,7 @@ int tail_main(int argc, char **argv)
203 status = EXIT_FAILURE; 203 status = EXIT_FAILURE;
204 } 204 }
205 205
206#ifdef BB_FEATURE_FANCY_TAIL 206#ifdef CONFIG_FEATURE_FANCY_TAIL
207 if (!from_top && units == BYTES) { 207 if (!from_top && units == BYTES) {
208 if (count < seen) 208 if (count < seen)
209 seen = count; 209 seen = count;
diff --git a/coreutils/tee.c b/coreutils/tee.c
index 64a0922b7..1c145426a 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -2,8 +2,7 @@
2/* 2/*
3 * Mini tee implementation for busybox 3 * Mini tee implementation for busybox
4 * 4 *
5 * Copyright (C) 1999,2000,2001 by Lineo, inc. 5 * Copyright (C) 2000,2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
6 * Written by Matt Kraai <kraai@alumni.carnegiemellon.edu>
7 * 6 *
8 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 1718da71e..267349596 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -2,9 +2,8 @@
2/* 2/*
3 * Mini touch implementation for busybox 3 * Mini touch implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 5b7b8d091..2665d926f 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -155,11 +155,11 @@ extern int tr_main(int argc, char **argv)
155 int output_length=0, input_length; 155 int output_length=0, input_length;
156 int idx = 1; 156 int idx = 1;
157 int i; 157 int i;
158 RESERVE_BB_BUFFER(output, BUFSIZ); 158 RESERVE_CONFIG_BUFFER(output, BUFSIZ);
159 RESERVE_BB_BUFFER(input, BUFSIZ); 159 RESERVE_CONFIG_BUFFER(input, BUFSIZ);
160 RESERVE_BB_UBUFFER(vector, ASCII+1); 160 RESERVE_CONFIG_UBUFFER(vector, ASCII+1);
161 RESERVE_BB_BUFFER(invec, ASCII+1); 161 RESERVE_CONFIG_BUFFER(invec, ASCII+1);
162 RESERVE_BB_BUFFER(outvec, ASCII+1); 162 RESERVE_CONFIG_BUFFER(outvec, ASCII+1);
163 163
164 /* ... but make them available globally */ 164 /* ... but make them available globally */
165 poutput = output; 165 poutput = output;
diff --git a/coreutils/uniq.c b/coreutils/uniq.c
index 53e3c64f2..cb63c4277 100644
--- a/coreutils/uniq.c
+++ b/coreutils/uniq.c
@@ -2,9 +2,8 @@
2/* 2/*
3 * Mini uniq implementation for busybox 3 * Mini uniq implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999 by Lineo, inc. and John Beppu
6 * Copyright (C) 1999,2000,2001 by Lineo, inc. 6 * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
7 * Written by John Beppu <beppu@lineo.com>
8 * Rewritten by Matt Kraai <kraai@alumni.carnegiemellon.edu> 7 * Rewritten by Matt Kraai <kraai@alumni.carnegiemellon.edu>
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index fc037403a..0a362a262 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -84,8 +84,8 @@ int uuencode_main(int argc, char **argv)
84{ 84{
85 const int src_buf_size = 60; // This *MUST* be a multiple of 3 85 const int src_buf_size = 60; // This *MUST* be a multiple of 3
86 const int dst_buf_size = 4 * ((src_buf_size + 2) / 3); 86 const int dst_buf_size = 4 * ((src_buf_size + 2) / 3);
87 RESERVE_BB_BUFFER(src_buf, src_buf_size + 1); 87 RESERVE_CONFIG_BUFFER(src_buf, src_buf_size + 1);
88 RESERVE_BB_BUFFER(dst_buf, dst_buf_size + 1); 88 RESERVE_CONFIG_BUFFER(dst_buf, dst_buf_size + 1);
89 struct stat stat_buf; 89 struct stat stat_buf;
90 FILE *src_stream = stdin; 90 FILE *src_stream = stdin;
91 char *tbl = tbl_std; 91 char *tbl = tbl_std;