aboutsummaryrefslogtreecommitdiff
path: root/lib/dirtree.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2008-02-21 04:44:42 -0600
committerRob Landley <rob@landley.net>2008-02-21 04:44:42 -0600
commit7f184faac064c66ba28dd44c0df94e34f60db8b0 (patch)
treed3ac34f8403cd4aef63944973b1d9a8dc157b904 /lib/dirtree.c
parent6e6871c3b253d26ab31e328dd5f9b6996b75688c (diff)
downloadtoybox-7f184faac064c66ba28dd44c0df94e34f60db8b0.tar.gz
Make cp pass most of its test suite. Still need to add symlink support.
Diffstat (limited to 'lib/dirtree.c')
-rw-r--r--lib/dirtree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/dirtree.c b/lib/dirtree.c
index a2647ee2..6cdacfe6 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -50,7 +50,7 @@ struct dirtree *dirtree_add_node(char *path)
// structures after use, and return NULL.
struct dirtree *dirtree_read(char *path, struct dirtree *parent,
- int (*callback)(struct dirtree *node, int after))
+ int (*callback)(char *path, struct dirtree *node))
{
struct dirtree *dt = NULL, **ddt = &dt;
DIR *dir;
@@ -72,10 +72,9 @@ struct dirtree *dirtree_read(char *path, struct dirtree *parent,
*ddt = dirtree_add_node(path);
if (!*ddt) continue;
(*ddt)->parent = parent;
- if (callback) callback(*ddt, 0);
+ if (callback) callback(path, *ddt);
if (entry->d_type == DT_DIR)
(*ddt)->child = dirtree_read(path, *ddt, callback);
- if (callback) callback(*ddt, 1);
if (callback) free(*ddt);
else ddt = &((*ddt)->next);
path[len]=0;