mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-15 20:12:08 +01:00
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.
This commit is contained in:
parent
5e0f90a930
commit
800bd78944
25
src/acl.c
25
src/acl.c
@ -1312,17 +1312,28 @@ int init_acl()
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user