The "users" file may have multiple $INCLUDES.
We DON'T want a "user" entry at line 266 of "$INCLUDE 1" to conflict
with a "DEFAULT" entry at line 266 of "$INCLUDE 2".
So we add an "order", which tracks the entry number. The "lineno"
is no longer used for ordering comparisons. Instead, it's only
used for debugging.
char const *name;
VALUE_PAIR *check;
VALUE_PAIR *reply;
+ int order; /* for ordering! */
int lineno;
struct pair_list *next;
} PAIR_LIST;
VALUE_PAIR *reply_tmp = NULL;
PAIR_LIST *pl = NULL, *t;
PAIR_LIST **last = &pl;
+ int order = 0;
int lineno = 0;
int entry_lineno = 0;
FR_TOKEN parsecode;
* of entries. Go to the end of the
* list.
*/
- while (*last)
+ while (*last) {
+ (*last)->order = order++;
last = &((*last)->next);
+ }
continue;
} /* $INCLUDE ... */
t->check = check_tmp;
t->reply = reply_tmp;
t->lineno = entry_lineno;
+ t->order = order++;
check_tmp = NULL;
reply_tmp = NULL;
pl = default_pl;
default_pl = default_pl->next;
- } else if (user_pl->lineno < default_pl->lineno) {
+ } else if (user_pl->order < default_pl->order) {
pl = user_pl;
user_pl = user_pl->next;