]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make iconv_message_list(mlp,encoding,encoding) work without warnings.
authorBruno Haible <bruno@clisp.org>
Tue, 15 Jan 2002 13:05:10 +0000 (13:05 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 23:01:11 +0000 (01:01 +0200)
src/ChangeLog
src/msgl-iconv.c

index 544c79cf02947115b99df446f9ef158097cd62e7..f849925235773c65198a11498269902f0f1315f5 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-13  Bruno Haible  <bruno@clisp.org>
+
+       * msgl-iconv.c (iconv_message_list): Don't complain by a nonportable
+       encoding name if it has been overridden by an argument canon_from_code.
+
 2002-01-13  Bruno Haible  <bruno@clisp.org>
 
        * msgl-ascii.c (is_ascii_message): Don't consider a message as being
index 06b857f9370653cc3b78242ea7c10de71f76c322..28d1f1747482df81c7e9a65db55d598dd8b52cd8 100644 (file)
@@ -1,5 +1,5 @@
 /* Message list charset and locale charset handling.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,7 @@
 #include "msgl-iconv.h"
 
 #include <errno.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -264,6 +265,7 @@ iconv_message_list (mlp, canon_from_code, canon_to_code)
      const char *canon_from_code;
      const char *canon_to_code;
 {
+  bool canon_from_code_overridden = (canon_from_code != NULL);
   size_t j;
 
   /* If the list is empty, nothing to do.  */
@@ -296,18 +298,23 @@ iconv_message_list (mlp, canon_from_code, canon_to_code)
 
                canon_charset = po_charset_canonicalize (charset);
                if (canon_charset == NULL)
-                 error (EXIT_FAILURE, 0,
-                        _("\
+                 {
+                   if (!canon_from_code_overridden)
+                     error (EXIT_FAILURE, 0,
+                            _("\
 present charset \"%s\" is not a portable encoding name"),
-                        charset);
-
-               if (canon_from_code == NULL)
-                 canon_from_code = canon_charset;
-               else if (canon_from_code != canon_charset)
-                 error (EXIT_FAILURE, 0,
-                        _("\
+                            charset);
+                 }
+               else
+                 {
+                   if (canon_from_code == NULL)
+                     canon_from_code = canon_charset;
+                   else if (canon_from_code != canon_charset)
+                     error (EXIT_FAILURE, 0,
+                            _("\
 two different charsets \"%s\" and \"%s\" in input file"),
-                        canon_from_code, canon_charset);
+                            canon_from_code, canon_charset);
+                 }
 
                len1 = charsetstr - header;
                len2 = strlen (canon_to_code);