aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-03-29 13:56:49 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-03-29 13:56:49 +0000
commit1c634bd6994eb67817ce151371e4ce25eef93430 (patch)
tree5b1f5fd6407cd4eb5ca2900c43cfeacf2d1d6728
parentfd1010b0131f75b9370dcf7895f27a85ca715651 (diff)
downloadbusybox-w32-1c634bd6994eb67817ce151371e4ce25eef93430.tar.gz
busybox-w32-1c634bd6994eb67817ce151371e4ce25eef93430.tar.bz2
busybox-w32-1c634bd6994eb67817ce151371e4ce25eef93430.zip
- use index_in_str_array also for find_main
text data bss dec hex filename 2605 1 12 2618 a3a find.o.r18274 2602 1 12 2615 a37 find.o.r18275 git-svn-id: svn://busybox.net/trunk/busybox@18275 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--findutils/find.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/findutils/find.c b/findutils/find.c
index f94bd2367..a4fe5d187 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -646,6 +646,11 @@ int find_main(int argc, char **argv)
646 char *arg; 646 char *arg;
647 char **argp; 647 char **argp;
648 int i, firstopt, status = EXIT_SUCCESS; 648 int i, firstopt, status = EXIT_SUCCESS;
649 const char * const options[] = {
650 "-follow",
651USE_FEATURE_FIND_XDEV( "-xdev", )
652 NULL
653 };
649 654
650 for (firstopt = 1; firstopt < argc; firstopt++) { 655 for (firstopt = 1; firstopt < argc; firstopt++) {
651 if (argv[firstopt][0] == '-') 656 if (argv[firstopt][0] == '-')
@@ -672,12 +677,13 @@ int find_main(int argc, char **argv)
672 /* (-a will be ignored by recursive parser later) */ 677 /* (-a will be ignored by recursive parser later) */
673 argp = &argv[firstopt]; 678 argp = &argv[firstopt];
674 while ((arg = argp[0])) { 679 while ((arg = argp[0])) {
675 if (strcmp(arg, "-follow") == 0) { 680 i = index_in_str_array(options, arg);
681 if (i == 0) { /* -follow */
676 dereference = TRUE; 682 dereference = TRUE;
677 argp[0] = (char*)"-a"; 683 argp[0] = (char*)"-a";
678 } 684 }
679#if ENABLE_FEATURE_FIND_XDEV 685#if ENABLE_FEATURE_FIND_XDEV
680 else if (strcmp(arg, "-xdev") == 0) { 686 else if (i == 1) { /* -xdev */
681 struct stat stbuf; 687 struct stat stbuf;
682 if (!xdev_count) { 688 if (!xdev_count) {
683 xdev_count = firstopt - 1; 689 xdev_count = firstopt - 1;