diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-09-16 19:20:51 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-09-16 19:20:51 +0000 |
commit | 1558ab4ce71d8db60e2897fc2ea8a963ded878dd (patch) | |
tree | c7ca3600d02ad2f937479b290a7eda8c9fcb543c /gdb/charset.c | |
parent | 4ef28648fb46ee431ce3d8d5cdceb8c171b81cb9 (diff) | |
download | gdb-1558ab4ce71d8db60e2897fc2ea8a963ded878dd.zip gdb-1558ab4ce71d8db60e2897fc2ea8a963ded878dd.tar.gz gdb-1558ab4ce71d8db60e2897fc2ea8a963ded878dd.tar.bz2 |
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 3274219..90d5717 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; |