This trailing whitespace is annoying when working with the textual output
of nft.
Before:
table t {
chain c {
ct state new
^
}
}
After:
table t {
chain c {
ct state new
}
}
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
list_for_each_entry(stmt, &rule->stmts, list) {
stmt->ops->print(stmt);
- printf(" ");
+ if (!list_is_last(&stmt->list, &rule->stmts))
+ printf(" ");
}
if (rule->comment)
- printf("comment \"%s\" ", rule->comment);
+ printf(" comment \"%s\"", rule->comment);
if (handle_output > 0)
- printf("# handle %" PRIu64, rule->handle.handle);
+ printf(" # handle %" PRIu64, rule->handle.handle);
}
struct scope *scope_init(struct scope *scope, const struct scope *parent)