diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-23 15:58:11 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-23 15:58:11 +0000 |
commit | 9ac9e55e3c1dd11bf007623ea672f7569366c186 (patch) | |
tree | 7f3b46d7f2f01fed698b569b3217ab5b52413aac /findutils | |
parent | e13a537795751bee8e2b7fe2b88c75436acd9da0 (diff) | |
download | busybox-w32-9ac9e55e3c1dd11bf007623ea672f7569366c186.tar.gz busybox-w32-9ac9e55e3c1dd11bf007623ea672f7569366c186.tar.bz2 busybox-w32-9ac9e55e3c1dd11bf007623ea672f7569366c186.zip |
sum: 40% size reduction (-300 bytes)
find: one_char -> LONE_CHAR
Diffstat (limited to 'findutils')
-rw-r--r-- | findutils/find.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/findutils/find.c b/findutils/find.c index 38bbfbec9..fffa3cd5c 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -75,11 +75,6 @@ USE_DESKTOP( ACTS(prune)) | |||
75 | static action ***actions; | 75 | static action ***actions; |
76 | static int need_print = 1; | 76 | static int need_print = 1; |
77 | 77 | ||
78 | static inline int one_char(const char* str, char c) | ||
79 | { | ||
80 | return (str[0] == c && str[1] == '\0'); | ||
81 | } | ||
82 | |||
83 | 78 | ||
84 | static int count_subst(const char *str) | 79 | static int count_subst(const char *str) |
85 | { | 80 | { |
@@ -455,7 +450,7 @@ action*** parse_params(char **argv) | |||
455 | while (1) { | 450 | while (1) { |
456 | if (!*argv) /* did not see ';' till end */ | 451 | if (!*argv) /* did not see ';' till end */ |
457 | bb_error_msg_and_die(bb_msg_requires_arg, arg); | 452 | bb_error_msg_and_die(bb_msg_requires_arg, arg); |
458 | if (one_char(argv[0], ';')) | 453 | if (LONE_CHAR(argv[0], ';')) |
459 | break; | 454 | break; |
460 | argv++; | 455 | argv++; |
461 | ap->exec_argc++; | 456 | ap->exec_argc++; |
@@ -469,7 +464,7 @@ action*** parse_params(char **argv) | |||
469 | } | 464 | } |
470 | #endif | 465 | #endif |
471 | #if ENABLE_DESKTOP | 466 | #if ENABLE_DESKTOP |
472 | else if (one_char(arg, '(')) { | 467 | else if (LONE_CHAR(arg, '(')) { |
473 | action_paren *ap; | 468 | action_paren *ap; |
474 | char **endarg; | 469 | char **endarg; |
475 | int nested = 1; | 470 | int nested = 1; |
@@ -478,9 +473,9 @@ action*** parse_params(char **argv) | |||
478 | while (1) { | 473 | while (1) { |
479 | if (!*++endarg) | 474 | if (!*++endarg) |
480 | bb_error_msg_and_die("unpaired '('"); | 475 | bb_error_msg_and_die("unpaired '('"); |
481 | if (one_char(*endarg, '(')) | 476 | if (LONE_CHAR(*endarg, '(')) |
482 | nested++; | 477 | nested++; |
483 | else if (one_char(*endarg, ')') && !--nested) { | 478 | else if (LONE_CHAR(*endarg, ')') && !--nested) { |
484 | *endarg = NULL; | 479 | *endarg = NULL; |
485 | break; | 480 | break; |
486 | } | 481 | } |
@@ -522,7 +517,7 @@ int find_main(int argc, char **argv) | |||
522 | if (argv[firstopt][0] == '-') | 517 | if (argv[firstopt][0] == '-') |
523 | break; | 518 | break; |
524 | #if ENABLE_DESKTOP | 519 | #if ENABLE_DESKTOP |
525 | if (one_char(argv[firstopt], '(')) | 520 | if (LONE_CHAR(argv[firstopt], '(')) |
526 | break; | 521 | break; |
527 | #endif | 522 | #endif |
528 | } | 523 | } |