|
|
| version 1.21.4.1, 2026/10/05 16:38:26 | version 1.22.2.1, 2026/10/07 22:07:30 |
|---|---|
| Line 83 _selectAttribute(cfg_root_t * __restrict cfg, const ch | Line 83 _selectAttribute(cfg_root_t * __restrict cfg, const ch |
| c = RB_FIND(tagRC, cfg, &fav); | c = RB_FIND(tagRC, cfg, &fav); |
| if (!c) | if (!c) |
| return NULL; /* not found */ | return NULL; /* not found */ |
| if ((!csSec && AIT_ISEMPTY(&c->cfg_sec)) || (csSec && !AIT_ISEMPTY(&c->cfg_sec) && | if ((!csSec && AIT_ISEMPTY(&c->cfg_sec)) || (csSec && !*csSec && AIT_ISEMPTY(&c->cfg_sec)) || |
| !strcmp(csSec, AIT_GET_STR(&c->cfg_sec)))) | (csSec && !AIT_ISEMPTY(&c->cfg_sec) && !strcmp(csSec, AIT_GET_STR(&c->cfg_sec)))) { |
| if (!AIT_ISEMPTY(&c->cfg_attr) && !strcmp(csAttr, AIT_GET_STR(&c->cfg_attr))) { | if (!AIT_ISEMPTY(&c->cfg_attr) && !strcmp(csAttr, AIT_GET_STR(&c->cfg_attr))) { |
| if (find) | if (find) |
| *find = 1; | *find = 1; |
| return c; /* FOUND! */ | return c; /* FOUND! */ |
| } | } |
| } | |
| /* if cannot find right attribute */ | /* if cannot find right attribute */ |
| TAILQ_FOREACH_SAFE(c, cfg, cfg_next, n) { | TAILQ_FOREACH_SAFE(c, cfg, cfg_next, n) { |
| if ((!csSec && AIT_ISEMPTY(&c->cfg_sec)) || | if ((!csSec && AIT_ISEMPTY(&c->cfg_sec)) || |
| (csSec && !AIT_ISEMPTY(&c->cfg_sec) && | (csSec && !*csSec && AIT_ISEMPTY(&c->cfg_sec)) || |
| !strcmp(csSec, AIT_GET_STR(&c->cfg_sec)))) | (csSec && !AIT_ISEMPTY(&c->cfg_sec) && |
| !strcmp(csSec, AIT_GET_STR(&c->cfg_sec)))) { | |
| if (!AIT_ISEMPTY(&c->cfg_attr) && csAttr && | if (!AIT_ISEMPTY(&c->cfg_attr) && csAttr && |
| !strcmp(csAttr, AIT_GET_STR(&c->cfg_attr))) { | !strcmp(csAttr, AIT_GET_STR(&c->cfg_attr))) { |
| if (find) | if (find) |
| *find = 2; | *find = 2; |
| return c; /* FOUND! */ | return c; /* FOUND! */ |
| } | } |
| } | |
| } | } |
| return NULL; /* not found */ | return NULL; /* not found */ |
| } | } |