Mercurial > hg > toybox
changeset 815:0c5b15cf4911
A couple quick fixes to find so I can try it out.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 13 Mar 2013 00:34:56 -0500 |
parents | ff5595fb5af2 |
children | 3a7defbc671e |
files | toys/pending/find.c |
diffstat | 1 files changed, 1 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/pending/find.c Wed Mar 13 00:27:40 2013 -0500 +++ b/toys/pending/find.c Wed Mar 13 00:34:56 2013 -0500 @@ -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 @@ } } -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 @@ } } - /* 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();