diff options
author | Patrick McHardy <kaber@trash.net> | 2015-11-15 16:10:45 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2015-11-15 16:10:45 +0000 |
commit | c552570dc67a56614c1053b9ea2fb27cd6ce106b (patch) | |
tree | 4fca6d4ed25a5abead43ec2890085d8e00b17ac1 /src/rule.c | |
parent | 2f16228172ff3629c09b7d0633e30c125aebc37e (diff) |
rule: move comment out of handle
The comment does not belong to the handle, it belongs to the rule.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -32,7 +32,6 @@ void handle_free(struct handle *h) xfree(h->table); xfree(h->chain); xfree(h->set); - xfree(h->comment); } void handle_merge(struct handle *dst, const struct handle *src) @@ -49,8 +48,6 @@ void handle_merge(struct handle *dst, const struct handle *src) dst->handle = src->handle; if (dst->position == 0) dst->position = src->position; - if (dst->comment == NULL && src->comment != NULL) - dst->comment = xstrdup(src->comment); } static LIST_HEAD(table_list); @@ -378,6 +375,7 @@ void rule_free(struct rule *rule) { stmt_list_free(&rule->stmts); handle_free(&rule->handle); + xfree(rule->comment); xfree(rule); } @@ -390,8 +388,8 @@ void rule_print(const struct rule *rule) printf(" "); } - if (rule->handle.comment) - printf("comment \"%s\" ", rule->handle.comment); + if (rule->comment) + printf("comment \"%s\" ", rule->comment); if (handle_output > 0) printf("# handle %" PRIu64, rule->handle.handle); |