aboutsummaryrefslogtreecommitdiff
path: root/livetree.c
diff options
context:
space:
mode:
Diffstat (limited to 'livetree.c')
-rw-r--r--livetree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/livetree.c b/livetree.c
index 3673de0..aecd278 100644
--- a/livetree.c
+++ b/livetree.c
@@ -478,7 +478,8 @@ struct node *get_node_by_path(struct node *tree, const char *path)
p = strchr(path, '/');
for_each_child(tree, child) {
- if (p && strneq(path, child->name, p-path))
+ if (p && (strlen(child->name) == p-path) &&
+ strneq(path, child->name, p-path))
return get_node_by_path(child, p+1);
else if (!p && streq(path, child->name))
return child;