aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-make
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-01-15 18:57:02 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-01-15 18:57:02 +0100
commit982e8caf70821d883cb80d3cc0c5700ed952345b (patch)
treec2b7626f50b16a204a7a7175f0222131f660547b /src/blogc-make
parent62919eee3ef5fbad678034c21948abed523fa47e (diff)
downloadblogc-982e8caf70821d883cb80d3cc0c5700ed952345b.tar.gz
blogc-982e8caf70821d883cb80d3cc0c5700ed952345b.tar.bz2
blogc-982e8caf70821d883cb80d3cc0c5700ed952345b.zip
make: fixed bug when trying to call a rule with incomplete name
previous code was calling all the rules that matched the substring provided. it should only run exact matches.
Diffstat (limited to 'src/blogc-make')
-rw-r--r--src/blogc-make/rules.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/blogc-make/rules.c b/src/blogc-make/rules.c
index 7927811..562cabe 100644
--- a/src/blogc-make/rules.c
+++ b/src/blogc-make/rules.c
@@ -818,13 +818,14 @@ bm_rule_executor(bm_ctx_t *ctx, bc_slist_t *rule_list)
rule = NULL;
for (size_t i = 0; rules[i].name != NULL; i++) {
- if (strlen(rules[i].name) < (sep - rule_str))
+ if (strlen(rules[i].name) != (sep - rule_str))
continue;
if (0 == strncmp(rule_str, rules[i].name, sep - rule_str)) {
rule = &(rules[i]);
rv = bm_rule_execute(ctx, rule, args);
if (rv != 0)
return rv;
+ break;
}
}
if (rule == NULL) {