From: Bruno Haible Date: Thu, 13 Oct 2005 11:03:39 +0000 (+0000) Subject: Fix handling of obsolete messages in libgettextpo. X-Git-Tag: v0.15~366 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=326bea11123b618e90bf7f13edf4bb0069eff8f2;p=thirdparty%2Fgettext.git Fix handling of obsolete messages in libgettextpo. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 630cdd964..58dcc3192 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2005-10-04 Bruno Haible + + Fix handling of obsolete messages. + * msgl-check.c (check_plural): Ignore obsolete messages. + * gettext-po.c (po_file_check_all, po_message_check_all, + po_message_check_format): Likewise. + 2005-10-04 Bruno Haible * msgl-check.h (check_message): Remove msgstr_pos argument. diff --git a/gettext-tools/src/gettext-po.c b/gettext-tools/src/gettext-po.c index 76a377321..32535a9b1 100644 --- a/gettext-tools/src/gettext-po.c +++ b/gettext-tools/src/gettext-po.c @@ -1038,7 +1038,8 @@ po_file_check_all (po_file_t file, po_xerror_handler_t handler) { message_ty *mp = mlp->item[j]; - check_message (mp, &mp->pos, 1, 1, 1, 0, 0, 0); + if (!mp->obsolete) + check_message (mp, &mp->pos, 1, 1, 1, 0, 0, 0); } check_plural (mlp); @@ -1068,7 +1069,8 @@ po_message_check_all (po_message_t message, po_message_iterator_t iterator, (void (*) (int, const message_ty *, const char *, size_t, size_t, int, const char *, const message_ty *, const char *, size_t, size_t, int, const char *)) handler->xerror2; - check_message (mp, &mp->pos, 1, 1, 1, 0, 0, 0); + if (!mp->obsolete) + check_message (mp, &mp->pos, 1, 1, 1, 0, 0, 0); /* For plural checking, combine the message and its header into a small, two-element message list. */ @@ -1131,7 +1133,8 @@ po_message_check_format (po_message_t message, po_xerror_handler_t handler) (void (*) (int, const message_ty *, const char *, size_t, size_t, int, const char *, const message_ty *, const char *, size_t, size_t, int, const char *)) handler->xerror2; - check_message (mp, &mp->pos, 0, 1, 0, 0, 0, 0); + if (!mp->obsolete) + check_message (mp, &mp->pos, 0, 1, 0, 0, 0, 0); /* Restore error handler. */ po_xerror = textmode_xerror; diff --git a/gettext-tools/src/msgl-check.c b/gettext-tools/src/msgl-check.c index a424c09d0..4dacc1f62 100644 --- a/gettext-tools/src/msgl-check.c +++ b/gettext-tools/src/msgl-check.c @@ -251,7 +251,7 @@ check_plural (message_list_ty *mlp) { message_ty *mp = mlp->item[j]; - if (mp->msgid_plural != NULL) + if (!mp->obsolete && mp->msgid_plural != NULL) { const char *p; const char *p_end; @@ -281,7 +281,7 @@ check_plural (message_list_ty *mlp) /* Look at the plural entry for this domain. Cf, function extract_plural_expression. */ header = message_list_search (mlp, NULL, ""); - if (header != NULL) + if (header != NULL && !header->obsolete) { const char *nullentry; const char *plural; @@ -716,7 +716,7 @@ some header fields still have the initial default value\n")); } -/* Perform all checks on a message. +/* Perform all checks on a non-obsolete message. Return nonzero if an error was seen. */ int check_message (const message_ty *mp, diff --git a/gettext-tools/src/msgl-check.h b/gettext-tools/src/msgl-check.h index e32f0d612..6edab9140 100644 --- a/gettext-tools/src/msgl-check.h +++ b/gettext-tools/src/msgl-check.h @@ -32,7 +32,7 @@ extern "C" { Return nonzero if an error was seen. */ extern int check_plural (message_list_ty *mlp); -/* Perform all checks on a message. +/* Perform all checks on a non-obsolete message. Return nonzero if an error was seen. */ extern int check_message (const message_ty *mp, const lex_pos_ty *msgid_pos,