aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2022-10-23 00:34:20 -0400
committerBruce Hill <bruce@bruce-hill.com>2022-10-23 00:34:20 -0400
commit302bfa11e7f8886f9f54d6c82ed34c8e4140cbae (patch)
tree21e41848960871f8f03aa6c845e940f636af7bc4
parent5db008dbd2084d90631b567ed5320566aa76b41c (diff)
Bugfix
-rw-r--r--match.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/match.c b/match.c
index 4eca7cb..6c55fbc 100644
--- a/match.c
+++ b/match.c
@@ -890,9 +890,12 @@ static match_t *_get_numbered_capture(match_t *m, int *n)
return NULL;
if ((m->pat->type == BP_CAPTURE && m->pat->args.capture.namelen == 0) || m->pat->type == BP_TAGGED) {
- if (*n == 1) return m;
- else return NULL;
- // --(*n);
+ if (*n == 1) {
+ return m;
+ } else {
+ --(*n);
+ return NULL;
+ }
}
if (m->children) {
for (int i = 0; m->children[i]; i++) {