summaryrefslogtreecommitdiff
path: root/gdb/charset.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-09-16 19:20:51 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-09-16 19:20:51 +0000
commit1558ab4ce71d8db60e2897fc2ea8a963ded878dd (patch)
treec7ca3600d02ad2f937479b290a7eda8c9fcb543c /gdb/charset.c
parent4ef28648fb46ee431ce3d8d5cdceb8c171b81cb9 (diff)
gdb/
* charset.c (wchar_iterate) <EILSEQ>: Return any possibly converted characters.
Diffstat (limited to 'gdb/charset.c')
-rw-r--r--gdb/charset.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/charset.c b/gdb/charset.c
index 3274219086..90d5717b57 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -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;