svn commit: trunk/busybox/findutils
aldot at busybox.net
aldot at busybox.net
Thu Mar 29 13:56:51 UTC 2007
Author: aldot
Date: 2007-03-29 06:56:49 -0700 (Thu, 29 Mar 2007)
New Revision: 18275
Log:
- 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
Modified:
trunk/busybox/findutils/find.c
Changeset:
Modified: trunk/busybox/findutils/find.c
===================================================================
--- trunk/busybox/findutils/find.c 2007-03-29 13:56:02 UTC (rev 18274)
+++ trunk/busybox/findutils/find.c 2007-03-29 13:56:49 UTC (rev 18275)
@@ -646,6 +646,11 @@
char *arg;
char **argp;
int i, firstopt, status = EXIT_SUCCESS;
+ const char * const options[] = {
+ "-follow",
+USE_FEATURE_FIND_XDEV( "-xdev", )
+ NULL
+ };
for (firstopt = 1; firstopt < argc; firstopt++) {
if (argv[firstopt][0] == '-')
@@ -672,12 +677,13 @@
/* (-a will be ignored by recursive parser later) */
argp = &argv[firstopt];
while ((arg = argp[0])) {
- if (strcmp(arg, "-follow") == 0) {
+ i = index_in_str_array(options, arg);
+ if (i == 0) { /* -follow */
dereference = TRUE;
argp[0] = (char*)"-a";
}
#if ENABLE_FEATURE_FIND_XDEV
- else if (strcmp(arg, "-xdev") == 0) {
+ else if (i == 1) { /* -xdev */
struct stat stbuf;
if (!xdev_count) {
xdev_count = firstopt - 1;
More information about the busybox-cvs
mailing list