* charset.c (wchar_iterate) <EILSEQ>: Return any possibly converted
	characters.
This commit is contained in:
Jan Kratochvil 2010-09-16 19:20:51 +00:00
parent 4ef28648fb
commit 1558ab4ce7
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-09-16 Jan Kratochvil <jan.kratochvil@redhat.com>
* charset.c (wchar_iterate) <EILSEQ>: Return any possibly converted
characters.
2010-09-16 Phil Muldoon <pmuldoon@redhat.com>
PR mi/11407

View File

@ -648,8 +648,13 @@ wchar_iterate (struct wchar_iterator *iter,
switch (errno)
{
case EILSEQ:
/* Invalid input sequence. Skip it, and let the caller
know about it. */
/* Invalid input sequence. We still might have converted a
character; if so, return it. */
if (out_avail < out_request * sizeof (gdb_wchar_t))
break;
/* Otherwise skip the first invalid character, and let the
caller know about it. */
*out_result = wchar_iterate_invalid;
*ptr = iter->input;
*len = iter->width;