Signed-off-by: Daniel Lezcano <daniel.lezc...@linaro.org>
---
 tree.c |    3 +++
 tree.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tree.c b/tree.c
index 8f546a9..dd53ff2 100644
--- a/tree.c
+++ b/tree.c
@@ -57,6 +57,7 @@ static inline struct tree *tree_alloc(const char *path, int 
depth)
        t->next = NULL;
        t->prev = NULL;
        t->private = NULL;
+       t->nrchild = 0;
 
        return t;
 }
@@ -161,6 +162,8 @@ static int tree_scan(struct tree *tree, tree_filter_t 
filter)
 
                        tree_add_child(tree, child);
 
+                       tree->nrchild++;
+
                        ret = tree_scan(child, filter);
                }
 
diff --git a/tree.h b/tree.h
index 88d4a19..c7f3ca9 100644
--- a/tree.h
+++ b/tree.h
@@ -33,6 +33,7 @@ struct tree {
        char *path;
        char *name;
        void *private;
+       int   nrchild;
        unsigned char depth;
 };
 
-- 
1.7.1


_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to