diff options
author | Amitay Isaacs <amitay@ozlabs.org> | 2019-03-14 17:44:49 +1100 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2019-03-26 13:17:41 +1100 |
commit | 6b57cfc68252de3e4114c02034e747995a22affa (patch) | |
tree | 559dffd941625a6e99b3af35ca18ccce1a7eda5f | |
parent | 56131274d6d913b039b606d1c578fb0ec37ee400 (diff) | |
download | pdbg-6b57cfc68252de3e4114c02034e747995a22affa.tar.gz pdbg-6b57cfc68252de3e4114c02034e747995a22affa.zip |
path: Avoid a match for nested nodes of the same class
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Tested-by: Rashmica Gupta <rashmica.g@gmail.com>
-rw-r--r-- | src/path.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -270,6 +270,19 @@ static void path_pattern_match(struct pdbg_target *target, } } + /* + * If we find the same class nested which is not a match, + * then stop recursion + */ + if (level > 0 && !strcmp(tok, pats[level-1].prefix)) { + if (pats[level-1].match_index) { + int index = pdbg_target_index(target); + + if (pats[level-1].index[index] != 1) + return; + } + } + end: pdbg_for_each_child_target(target, child) { path_pattern_match(child, pats, max_levels, next); |