aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-02-06 17:38:29 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-02-06 17:38:29 +0000
commit35179d30707811e8670403d157557c56ab2e5726 (patch)
tree68f077ddbd397621ba58dba4cc6161b96b24b285
parente84333341b74188d901c2784f00b4c970b419be0 (diff)
downloadbusybox-w32-35179d30707811e8670403d157557c56ab2e5726.tar.gz
busybox-w32-35179d30707811e8670403d157557c56ab2e5726.tar.bz2
busybox-w32-35179d30707811e8670403d157557c56ab2e5726.zip
find: fix -not support
git-svn-id: svn://busybox.net/trunk/busybox@17794 69ca8d6d-28ef-0310-b511-8ec308f3f277
-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