diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-09-16 19:20:50 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-09-16 19:20:50 +0000 |
commit | e884cc5b62f170280dd49a35793bb516d95e7d8d (patch) | |
tree | db33113c1fc11e70811916ddeb720a87ce353e82 /gdb/charset.c | |
parent | 6ab8c51073a44168a14e41f7c5d590096d1e595d (diff) | |
download | gdb-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.c | 9 |
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; |