+2001-09-01 Bruno Haible <haible@clisp.cons.org>
+
+ * message.c (message_list_list_search): If the first match has an
+ empty translation but there is later in the list a non-empty
+ translation, return the latter one. This fixes the msgmerge-8 test.
+
2001-08-30 Bruno Haible <haible@clisp.cons.org>
Reorganize msgfmt checking options.
message_list_list_ty *mllp;
const char *msgid;
{
+ message_ty *best_mp;
+ int best_weight; /* 0: not found, 1: found without msgstr, 2: translated */
size_t j;
+ best_mp = NULL;
+ best_weight = 0;
for (j = 0; j < mllp->nitems; ++j)
{
message_list_ty *mlp;
mlp = mllp->item[j];
mp = message_list_search (mlp, msgid);
if (mp)
- return mp;
+ {
+ int weight = (mp->msgstr_len == 1 && mp->msgstr[0] == '\0' ? 1 : 2);
+ if (weight > best_weight)
+ {
+ best_mp = mp;
+ best_weight = weight;
+ }
+ }
}
- return NULL;
+ return best_mp;
}