From 982e8caf70821d883cb80d3cc0c5700ed952345b Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Tue, 15 Jan 2019 18:57:02 +0100 Subject: 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. --- src/blogc-make/rules.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3-18-g5258