+2001-09-23 Bruno Haible <haible@clisp.cons.org>
+
+ * xgettext.c (remember_a_message): Warn about empty msgid if it
+ conflicts with construct_header().
+
2001-09-08 Bruno Haible <haible@clisp.cons.org>
* msgcat.c (main): Move the option checking after the handling of
#include "file-list.h"
#include "error.h"
#include "progname.h"
+#include "xerror.h"
#include "getline.h"
#include "system.h"
#include "po.h"
is_format[i] = undecided;
do_wrap = undecided;
+ if (msgid[0] == '\0' && !omit_header)
+ {
+ error_with_progname = false;
+ multiline_warning (xasprintf ("%s:%d: warning: ", pos->file_name,
+ pos->line_number),
+ xstrdup (_("\
+Empty msgid. It is reserved by GNU gettext:\n\
+gettext(\"\") returns the header entry with\n\
+meta information, not the empty string.\n")));
+ error_with_progname = true;
+ }
+
/* See if we have seen this message before. */
mp = message_list_search (mlp, msgid);
if (mp != NULL)
}
else
{
- static lex_pos_ty pos = { __FILE__, __LINE__ };
+ static lex_pos_ty dummypos = { __FILE__, __LINE__ };
/* Construct the msgstr from the prefix and suffix, otherwise use the
empty string. */
msgstr = "";
/* Allocate a new message and append the message to the list. */
- mp = message_alloc (msgid, NULL, msgstr, strlen (msgstr) + 1, &pos);
+ mp = message_alloc (msgid, NULL, msgstr, strlen (msgstr) + 1, &dummypos);
/* Do not free msgid. */
message_list_append (mlp, mp);
}