diff options
author | Bruno Haible <bruno@clisp.org> | 2002-01-15 13:05:10 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-22 01:01:11 +0200 |
commit | 146a59ce31852252d9e44f471242fcedf595572d (patch) | |
tree | b597473f21fb3d72381462f00df81f489152e141 | |
parent | 75cc8b89ab624a205f4934e293436098a7c568fa (diff) | |
download | external_gettext-146a59ce31852252d9e44f471242fcedf595572d.zip external_gettext-146a59ce31852252d9e44f471242fcedf595572d.tar.gz external_gettext-146a59ce31852252d9e44f471242fcedf595572d.tar.bz2 |
Make iconv_message_list(mlp,encoding,encoding) work without warnings.
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/msgl-iconv.c | 29 |
2 files changed, 23 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 544c79c..f849925 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 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 ASCII if its msgid or msgid_plural is not ASCII. diff --git a/src/msgl-iconv.c b/src/msgl-iconv.c index 06b857f..28d1f17 100644 --- a/src/msgl-iconv.c +++ b/src/msgl-iconv.c @@ -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); |