+2001-06-10 Bruno Haible <haible@clisp.cons.org>
+
+ * message.h (message_list_prepend): New declaration.
+ * message.c (message_list_prepend): New function.
+ * msgmerge.c (merge): Add a header entry to the ref list if it has
+ none.
+
2001-06-10 Bruno Haible <haible@clisp.cons.org>
* msgfmt.c: Change the --strict option to not apply to domain
message_list_ty *message_list_alloc PARAMS ((void));
void message_list_free PARAMS ((message_list_ty *));
void message_list_append PARAMS ((message_list_ty *, message_ty *));
+void message_list_prepend PARAMS ((message_list_ty *, message_ty *));
void message_list_delete_nth PARAMS ((message_list_ty *, size_t));
message_ty *message_list_search PARAMS ((message_list_ty *, const char *));
message_ty *message_list_search_fuzzy PARAMS ((message_list_ty *,
/* This is the references file, created by groping the sources with
the xgettext program. */
ref = read_po_file (fn2);
+ /* Add a dummy header entry, if the references file contains none. */
+ if (message_list_search (ref, "") == NULL)
+ {
+ static lex_pos_ty pos = { __FILE__, __LINE__ };
+ message_ty *refmsg = message_alloc ("", NULL);
+
+ message_variant_append (refmsg, MESSAGE_DOMAIN_DEFAULT, "", 1, &pos);
+ message_list_prepend (ref, refmsg);
+ }
result = message_list_alloc ();
continue;
}
+ /* Special treatment for the header entry. */
+ if (refmsg->msgid[0] == '\0')
+ continue;
+
/* If the message was not defined at all, try to find a very
similar message, it could be a typo, or the suggestion may
help. */