1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

(handle_iconv_error): Turn diagnostics into warnings

so that gpg does not return with failure.
(native_to_utf8, utf8_to_native): Ditto.
This commit is contained in:
Werner Koch 2004-12-20 08:55:03 +00:00
parent 07250279e7
commit be4bb5a88b
3 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,14 @@
2004-12-20 Werner Koch <wk@g10code.com>
* strgutil.c (handle_iconv_error): Turn diagnostics into warnings
so that gpg does not return with failure.
(native_to_utf8, utf8_to_native): Ditto.
2004-12-16 Werner Koch <wk@g10code.com>
* iobuf.c (fd_cache_strcmp) [W32]: Casting is a Bad Thing. Cast to
an unsigned char pointer and to an unsigned integer.
2004-12-18 David Shaw <dshaw@jabberwocky.com> 2004-12-18 David Shaw <dshaw@jabberwocky.com>
* ttyio.c: Use only HAVE_LIBREADLINE to detect readline * ttyio.c: Use only HAVE_LIBREADLINE to detect readline

View File

@ -146,7 +146,7 @@ fd_cache_strcmp (const char *a, const char *b)
|| (*a == '\\' && *b == '/')) ) || (*a == '\\' && *b == '/')) )
break; break;
} }
return *(const unsigned *)a - *(const unsigned *)b; return *(const unsigned char *)a - *(const unsigned char *)b;
#else #else
return strcmp (a, b); return strcmp (a, b);
#endif #endif

View File

@ -451,10 +451,10 @@ static void
handle_iconv_error (const char *to, const char *from, int use_fallback) handle_iconv_error (const char *to, const char *from, int use_fallback)
{ {
if (errno == EINVAL) if (errno == EINVAL)
log_error (_("conversion from `%s' to `%s' not available\n"), log_info (_("conversion from `%s' to `%s' not available\n"),
from, to); from, to);
else else
log_error (_("iconv_open failed: %s\n"), strerror (errno)); log_info (_("iconv_open failed: %s\n"), strerror (errno));
if (use_fallback) if (use_fallback)
{ {
@ -645,7 +645,7 @@ native_to_utf8( const char *string )
if ( iconv (cd, (ICONV_CONST char **)&inptr, &inbytes, if ( iconv (cd, (ICONV_CONST char **)&inptr, &inbytes,
&outptr, &outbytes) == (size_t)-1) &outptr, &outbytes) == (size_t)-1)
{ {
log_error (_("conversion from `%s' to `%s' failed: %s\n"), log_info (_("conversion from `%s' to `%s' failed: %s\n"),
active_charset_name, "utf-8", strerror (errno)); active_charset_name, "utf-8", strerror (errno));
/* We don't do any conversion at all but use the strings as is. */ /* We don't do any conversion at all but use the strings as is. */
strcpy (buffer, string); strcpy (buffer, string);
@ -919,7 +919,7 @@ utf8_to_native( const char *string, size_t length, int delim )
outbuf = outptr = m_alloc (outbytes); outbuf = outptr = m_alloc (outbytes);
if ( iconv (cd, (ICONV_CONST char **)&inptr, &inbytes, if ( iconv (cd, (ICONV_CONST char **)&inptr, &inbytes,
&outptr, &outbytes) == (size_t)-1) { &outptr, &outbytes) == (size_t)-1) {
log_error (_("conversion from `%s' to `%s' failed: %s\n"), log_info (_("conversion from `%s' to `%s' failed: %s\n"),
"utf-8", active_charset_name, strerror (errno)); "utf-8", active_charset_name, strerror (errno));
/* Didn't worked out. Temporary disable the use of /* Didn't worked out. Temporary disable the use of
* iconv and fall back to our old code. */ * iconv and fall back to our old code. */