aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-02-06 17:38:29 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-02-06 17:38:29 +0000
commitb292264bfd7064b651192b966f30d76b75161c70 (patch)
tree68f077ddbd397621ba58dba4cc6161b96b24b285
parent1d76f439da81d3a05f0e0fdde3f81ec56fb20836 (diff)
downloadbusybox-w32-b292264bfd7064b651192b966f30d76b75161c70.tar.gz
busybox-w32-b292264bfd7064b651192b966f30d76b75161c70.tar.bz2
busybox-w32-b292264bfd7064b651192b966f30d76b75161c70.zip
find: fix -not support
-rw-r--r--findutils/find.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/findutils/find.c b/findutils/find.c
index 5645b5a4d..e98d995a4 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -352,6 +352,7 @@ static action*** parse_params(char **argv)
352 appp[cur_group][cur_action] = NULL; 352 appp[cur_group][cur_action] = NULL;
353 ap->f = f; 353 ap->f = f;
354 USE_FEATURE_FIND_NOT( ap->invert = invert_flag; ) 354 USE_FEATURE_FIND_NOT( ap->invert = invert_flag; )
355 USE_FEATURE_FIND_NOT( invert_flag = 0; )
355 return ap; 356 return ap;
356 } 357 }
357#define ALLOC_ACTION(name) (action_##name*)alloc_action(sizeof(action_##name), (action_fp) func_##name) 358#define ALLOC_ACTION(name) (action_##name*)alloc_action(sizeof(action_##name), (action_fp) func_##name)
@@ -380,14 +381,12 @@ static action*** parse_params(char **argv)
380 if (strcmp(arg, "-a") == 0 381 if (strcmp(arg, "-a") == 0
381 USE_DESKTOP(|| strcmp(arg, "-and") == 0) 382 USE_DESKTOP(|| strcmp(arg, "-and") == 0)
382 ) { 383 ) {
383 USE_FEATURE_FIND_NOT( invert_flag = 0; )
384 /* no further special handling required */ 384 /* no further special handling required */
385 } 385 }
386 else if (strcmp(arg, "-o") == 0 386 else if (strcmp(arg, "-o") == 0
387 USE_DESKTOP(|| strcmp(arg, "-or") == 0) 387 USE_DESKTOP(|| strcmp(arg, "-or") == 0)
388 ) { 388 ) {
389 /* start new OR group */ 389 /* start new OR group */
390 USE_FEATURE_FIND_NOT( invert_flag = 0; )
391 cur_group++; 390 cur_group++;
392 appp = xrealloc(appp, (cur_group+2) * sizeof(*appp)); 391 appp = xrealloc(appp, (cur_group+2) * sizeof(*appp));
393 /*appp[cur_group] = NULL; - already NULL */ 392 /*appp[cur_group] = NULL; - already NULL */
@@ -398,7 +397,8 @@ static action*** parse_params(char **argv)
398 else if (LONE_CHAR(arg, '!') 397 else if (LONE_CHAR(arg, '!')
399 USE_DESKTOP(|| strcmp(arg, "-not") == 0) 398 USE_DESKTOP(|| strcmp(arg, "-not") == 0)
400 ) { 399 ) {
401 invert_flag = 1; 400 /* also handles "find ! ! -name 'foo*'" */
401 invert_flag ^= 1;
402 } 402 }
403#endif 403#endif
404 404