From: Bruno Haible Date: Mon, 21 Jan 2002 13:23:18 +0000 (+0000) Subject: Change some msgfmt error message to include the file name. X-Git-Tag: v0.11~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a7461750cebbf1dcb7a4fe267ac77ea5671037d;p=thirdparty%2Fgettext.git Change some msgfmt error message to include the file name. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 1ff942de5..feda4f4dc 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2002-01-19 Bruno Haible + + * xerror.c (multiline_warning): Add a newline if the message doesn't + terminate with a newline. + 2002-01-12 Bruno Haible * gettext.h (gettext_noop): Remove the parentheses around the diff --git a/lib/xerror.c b/lib/xerror.c index 349bb734e..424715374 100644 --- a/lib/xerror.c +++ b/lib/xerror.c @@ -1,5 +1,5 @@ /* Multiline error-reporting functions. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -118,6 +118,9 @@ multiline_warning (prefix, message) if (np == NULL || np[1] == '\0') { fputs (cp, stderr); + /* Temporary hack for gettext-0.11 check_header_entry function. */ + if (np == NULL) + fputc ('\n', stderr); break; } diff --git a/src/ChangeLog b/src/ChangeLog index d370b1baa..c5c5f9cee 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-01-19 Bruno Haible + + * msgfmt.c (check_header_entry): Emit error messages including the + file name. + 2002-01-19 Bruno Haible * open-po.c (open_po_file): Use 'size_t' instead of 'int'. diff --git a/src/msgfmt.c b/src/msgfmt.c index 08d2159fd..523ffb85d 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -1197,11 +1197,14 @@ check_header_entry (msgstr_string) char *endp = strstr (msgstr_string, required_fields[cnt]); if (endp == NULL) - error (0, 0, _("headerfield `%s' missing in header"), - required_fields[cnt]); + multiline_error (xasprintf ("%s: ", gram_pos.file_name), + xasprintf (_("headerfield `%s' missing in header"), + required_fields[cnt])); else if (endp != msgstr_string && endp[-1] != '\n') - error (0, 0, _("header field `%s' should start at beginning of line"), - required_fields[cnt]); + multiline_error (xasprintf ("%s: ", gram_pos.file_name), + xasprintf (_("\ +header field `%s' should start at beginning of line"), + required_fields[cnt])); else if (default_values[cnt] != NULL && strncmp (default_values[cnt], endp + strlen (required_fields[cnt]) + 2, @@ -1209,8 +1212,9 @@ check_header_entry (msgstr_string) { if (initial != -1) { - error (0, 0, _("\ -some header fields still have the initial default value")); + multiline_error (xasprintf ("%s: ", gram_pos.file_name), + xstrdup (_("\ +some header fields still have the initial default value"))); initial = -1; break; } @@ -1220,8 +1224,9 @@ some header fields still have the initial default value")); } if (initial != -1) - error (0, 0, _("field `%s' still has initial default value"), - required_fields[initial]); + multiline_error (xasprintf ("%s: ", gram_pos.file_name), + xasprintf (_("field `%s' still has initial default value"), + required_fields[initial])); }