summaryrefslogtreecommitdiff
path: root/gdb/charset.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-09-16 19:20:50 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-09-16 19:20:50 +0000
commite884cc5b62f170280dd49a35793bb516d95e7d8d (patch)
treedb33113c1fc11e70811916ddeb720a87ce353e82 /gdb/charset.c
parent6ab8c51073a44168a14e41f7c5d590096d1e595d (diff)
downloadgdb-e884cc5b62f170280dd49a35793bb516d95e7d8d.tar.gz
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 32742190865..90d5717b573 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;