forked from github/server
avoid running over the array of locales in order.c when re-creating locales for tests.
This commit is contained in:
parent
43351e03cd
commit
95ab2826ec
|
@ -40,8 +40,7 @@ typedef struct locale_data {
|
||||||
const struct locale *lang;
|
const struct locale *lang;
|
||||||
} locale_data;
|
} locale_data;
|
||||||
|
|
||||||
static struct locale_data *locale_array[16];
|
static struct locale_data *locale_array[MAXLOCALES];
|
||||||
static int nlocales = 0;
|
|
||||||
|
|
||||||
typedef struct order_data {
|
typedef struct order_data {
|
||||||
const char *_str;
|
const char *_str;
|
||||||
|
@ -272,15 +271,10 @@ static order *create_order_i(keyword_t kwd, const char *sptr, int persistent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (lindex = 0; lindex != nlocales; ++lindex) {
|
lindex = locale_index(lang);
|
||||||
if (locale_array[lindex]->lang == lang)
|
assert(lindex < MAXLOCALES);
|
||||||
break;
|
locale_array[lindex] = (locale_data *)calloc(1, sizeof(locale_data));
|
||||||
}
|
locale_array[lindex]->lang = lang;
|
||||||
if (lindex == nlocales) {
|
|
||||||
locale_array[nlocales] = (locale_data *)calloc(1, sizeof(locale_data));
|
|
||||||
locale_array[nlocales]->lang = lang;
|
|
||||||
++nlocales;
|
|
||||||
}
|
|
||||||
|
|
||||||
ord = (order *)malloc(sizeof(order));
|
ord = (order *)malloc(sizeof(order));
|
||||||
ord->_persistent = persistent;
|
ord->_persistent = persistent;
|
||||||
|
|
Loading…
Reference in New Issue