]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix handling of obsolete messages in libgettextpo.
authorBruno Haible <bruno@clisp.org>
Thu, 13 Oct 2005 11:03:39 +0000 (11:03 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:54 +0000 (12:12 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/gettext-po.c
gettext-tools/src/msgl-check.c
gettext-tools/src/msgl-check.h

index 630cdd964334e891ae358a1466250c6536fe7dc1..58dcc3192b9fe96d421d693c7a75a9e0488bcb44 100644 (file)
@@ -1,3 +1,10 @@
+2005-10-04  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        * msgl-check.h (check_message): Remove msgstr_pos argument.
index 76a3773217216af49b23a84b7db8b1d4e9356695..32535a9b18db6b95d57a806ef9dc7d0231236f5d 100644 (file)
@@ -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;
index a424c09d0cb947f140960a198cb79fe613d79239..4dacc1f62968dfe8a90f7f7e8d8fc8f2b1029f2c 100644 (file)
@@ -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,
index e32f0d612c6ed422c327061653c1deaf3d24ca6d..6edab91409e43d6971b09c9e03c784ab97c74bb7 100644 (file)
@@ -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,