From: Bruno Haible Date: Wed, 28 Nov 2001 17:03:17 +0000 (+0000) Subject: Emit a warning if the header entry exists but is fuzzy. X-Git-Tag: v0.11~260 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b58ca3a736c70d884ccff1ba57ada1a4de3a1a95;p=thirdparty%2Fgettext.git Emit a warning if the header entry exists but is fuzzy. --- diff --git a/src/ChangeLog b/src/ChangeLog index ec3d76137..8cb1c7c69 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2001-11-27 Bruno Haible + + * msgfmt.c (struct msgfmt_class_ty): New field + 'has_nonfuzzy_header_entry'. + (format_constructor): Initialize it. + (format_debrief): Give a warning if the header entry exists but is + fuzzy. + (format_directive_message): Update has_nonfuzzy_header_entry. + 2001-11-25 Bruno Haible * x-c.c (comment_start, comment_add, comment_line_end): New inline diff --git a/src/msgfmt.c b/src/msgfmt.c index e900180f8..811f525aa 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -67,6 +67,7 @@ struct msgfmt_class_ty enum is_wrap do_wrap; bool has_header_entry; + bool has_nonfuzzy_header_entry; }; /* Contains exit status for case in which no premature exit occurs. */ @@ -1207,6 +1208,7 @@ format_constructor (that) this->is_format[i] = undecided; this->do_wrap = undecided; this->has_header_entry = false; + this->has_nonfuzzy_header_entry = false; } @@ -1218,14 +1220,29 @@ format_debrief (that) msgfmt_class_ty *this = (msgfmt_class_ty *) that; /* Test whether header entry was found. */ - if (check_header && !this->has_header_entry) + if (check_header) { - multiline_error (xasprintf ("%s: ", gram_pos.file_name), - xasprintf (_("\ -warning: PO file header missing, fuzzy, or invalid\n"))); - multiline_error (NULL, - xasprintf (_("\ + if (!this->has_header_entry) + { + multiline_error (xasprintf ("%s: ", gram_pos.file_name), + xasprintf (_("\ +warning: PO file header missing or invalid\n"))); + multiline_error (NULL, + xasprintf (_("\ warning: charset conversion will not work\n"))); + } + else if (!this->has_nonfuzzy_header_entry) + { + /* Has only a fuzzy header entry. Since the versions 0.10.xx + ignore a fuzzy header entry and even give an error on it, we + give a warning, to increase operability with these older + msgfmt versions. This warning can go away in January 2003. */ + multiline_warning (xasprintf ("%s: ", gram_pos.file_name), + xasprintf (_("warning: PO file header fuzzy\n"))); + multiline_warning (NULL, + xasprintf (_("\ +warning: older versions of msgfmt will give an error on this\n"))); + } } } @@ -1355,6 +1372,8 @@ format_directive_message (that, msgid_string, msgid_pos, msgid_plural, if (msgid_string[0] == '\0') { this->has_header_entry = true; + if (!this->is_fuzzy) + this->has_nonfuzzy_header_entry = true; /* Do some more tests on the contents of the header entry. */