MINOR: acl: alphanumerically sort the ACL dump
The mechanism is similar to others. We take care of sorting on the
keyword only and not the fetch_kw which is not unique.
diff --git a/src/acl.c b/src/acl.c
index 77d6717..15ca766 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -1312,17 +1312,28 @@
void acl_dump_kwd(void)
{
struct acl_kw_list *kwl;
+ const struct acl_keyword *kwp, *kw;
const char *name;
int index;
- list_for_each_entry(kwl, &acl_keywords.list, list) {
- for (index = 0; kwl->kw[index].kw != NULL; index++) {
- name = kwl->kw[index].fetch_kw;
- if (!name)
- name = kwl->kw[index].kw;
-
- printf("%s = %s -m %s\n", kwl->kw[index].kw, name, pat_match_names[kwl->kw[index].match_type]);
+ for (kw = kwp = NULL;; kwp = kw) {
+ list_for_each_entry(kwl, &acl_keywords.list, list) {
+ for (index = 0; kwl->kw[index].kw != NULL; index++) {
+ if (strordered(kwp ? kwp->kw : NULL,
+ kwl->kw[index].kw,
+ kw != kwp ? kw->kw : NULL))
+ kw = &kwl->kw[index];
+ }
}
+
+ if (kw == kwp)
+ break;
+
+ name = kw->fetch_kw;
+ if (!name)
+ name = kw->kw;
+
+ printf("%s = %s -m %s\n", kw->kw, name, pat_match_names[kw->match_type]);
}
}