aboutsummaryrefslogtreecommitdiff
path: root/findutils/find.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-02-04 16:09:04 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-02-04 16:09:04 +0000
commit10b7996c1bcdeb66675251f5dff3d3ad57ab44f8 (patch)
treed465a58139ff0b83e8ec29097d9afbd5eb1bceb1 /findutils/find.c
parentcbd6e657442ebec5bacf29ae69cbd954c7fac65d (diff)
downloadbusybox-w32-10b7996c1bcdeb66675251f5dff3d3ad57ab44f8.tar.gz
busybox-w32-10b7996c1bcdeb66675251f5dff3d3ad57ab44f8.tar.bz2
busybox-w32-10b7996c1bcdeb66675251f5dff3d3ad57ab44f8.zip
- strip 12 bytes off by using a smaller type for need_print.
- add TODO to switch this applet to index_in_str_array()
Diffstat (limited to 'findutils/find.c')
-rw-r--r--findutils/find.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/findutils/find.c b/findutils/find.c
index b4ef7cbaa..bfdd84497 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -67,20 +67,20 @@ USE_FEATURE_FIND_MTIME( ACTS(mtime, char mtime_char; unsigned mtime_days;))
67USE_FEATURE_FIND_MMIN( ACTS(mmin, char mmin_char; unsigned mmin_mins;)) 67USE_FEATURE_FIND_MMIN( ACTS(mmin, char mmin_char; unsigned mmin_mins;))
68USE_FEATURE_FIND_NEWER( ACTS(newer, time_t newer_mtime;)) 68USE_FEATURE_FIND_NEWER( ACTS(newer, time_t newer_mtime;))
69USE_FEATURE_FIND_INUM( ACTS(inum, ino_t inode_num;)) 69USE_FEATURE_FIND_INUM( ACTS(inum, ino_t inode_num;))
70USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; int *subst_count; int exec_argc;)) 70USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; unsigned int *subst_count; int exec_argc;))
71USE_FEATURE_FIND_USER( ACTS(user, int uid;)) 71USE_FEATURE_FIND_USER( ACTS(user, int uid;))
72USE_DESKTOP( ACTS(paren, action ***subexpr;)) 72USE_DESKTOP( ACTS(paren, action ***subexpr;))
73USE_DESKTOP( ACTS(size, off_t size;)) 73USE_DESKTOP( ACTS(size, off_t size;))
74USE_DESKTOP( ACTS(prune)) 74USE_DESKTOP( ACTS(prune))
75 75
76static action ***actions; 76static action ***actions;
77static int need_print = 1; 77static smalluint need_print = 1;
78 78
79 79
80#if ENABLE_FEATURE_FIND_EXEC 80#if ENABLE_FEATURE_FIND_EXEC
81static int count_subst(const char *str) 81static unsigned int count_subst(const char *str)
82{ 82{
83 int count = 0; 83 unsigned int count = 0;
84 while ((str = strstr(str, "{}"))) { 84 while ((str = strstr(str, "{}"))) {
85 count++; 85 count++;
86 str++; 86 str++;
@@ -89,7 +89,7 @@ static int count_subst(const char *str)
89} 89}
90 90
91 91
92static char* subst(const char *src, int count, const char* filename) 92static char* subst(const char *src, unsigned int count, const char* filename)
93{ 93{
94 char *buf, *dst, *end; 94 char *buf, *dst, *end;
95 int flen = strlen(filename); 95 int flen = strlen(filename);
@@ -329,8 +329,8 @@ static const char* plus_minus_num(const char* str)
329static action*** parse_params(char **argv) 329static action*** parse_params(char **argv)
330{ 330{
331 action*** appp; 331 action*** appp;
332 int cur_group = 0; 332 unsigned cur_group = 0;
333 int cur_action = 0; 333 unsigned cur_action = 0;
334 334
335 action* alloc_action(int sizeof_struct, action_fp f) 335 action* alloc_action(int sizeof_struct, action_fp f)
336 { 336 {
@@ -359,6 +359,7 @@ static action*** parse_params(char **argv)
359// expr1 , expr2 List; both expr1 and expr2 are always evaluated 359// expr1 , expr2 List; both expr1 and expr2 are always evaluated
360// We implement: (), -a, -o 360// We implement: (), -a, -o
361 361
362//XXX: TODO: Use index_in_str_array here
362 while (*argv) { 363 while (*argv) {
363 const char *arg = argv[0]; 364 const char *arg = argv[0];
364 const char *arg1 = argv[1]; 365 const char *arg1 = argv[1];
@@ -504,7 +505,7 @@ static action*** parse_params(char **argv)
504 else if (LONE_CHAR(arg, '(')) { 505 else if (LONE_CHAR(arg, '(')) {
505 action_paren *ap; 506 action_paren *ap;
506 char **endarg; 507 char **endarg;
507 int nested = 1; 508 unsigned nested = 1;
508 509
509 endarg = argv; 510 endarg = argv;
510 while (1) { 511 while (1) {