From db12a37a97df8f0098e99f50f49a97175861ff28 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 13 Mar 2013 00:34:56 -0500 Subject: A couple quick fixes to find so I can try it out. --- toys/pending/find.c | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/toys/pending/find.c b/toys/pending/find.c index dddca5f5..d40db184 100644 --- a/toys/pending/find.c +++ b/toys/pending/find.c @@ -6,7 +6,7 @@ * * See http://opengroup.org/onlinepubs/9699919799/utilities/find.html -USE_LINK(NEWTOY(find, "?", TOYFLAG_USR|TOYFLAG_BIN)) +USE_FIND(NEWTOY(find, "?", TOYFLAG_USR|TOYFLAG_BIN)) config FIND bool "find" @@ -667,39 +667,6 @@ void build_filter_list(void) } } -int test_callback(struct dirtree *node) -{ - char *path; - int plen; - - //printf("%s: ", node->name); - - /* skip non-root '.' and all '..' */ - if (node->name[0] == '.' && - ((!node->name[1] && node->parent) || - (node->name[1]=='.' && !node->name[2]))) { - //printf("skipping\n"); - return 0; - } - - //printf("\n"); - path = dirtree_path(node, &plen); - printf("%s\n", path); - free(path); - return DIRTREE_RECURSE; -} - -void dt_test(void) -{ - struct dirtree *root; - - printf("testing dirtree routines...\n"); - - root = dirtree_read(".", test_callback); - printf("root=%p\n", root); - exit(0); -} - void find_main(void) { int i; @@ -716,11 +683,6 @@ void find_main(void) } } - /* change if to enalbe dt_test routine */ - if (debug && 0) { - dt_test(); - } - /* parse filters, if present */ /* also, fill toybuf with the directory to start in, if present */ build_filter_list(); -- cgit v1.2.3