This is the mail archive of the cygwin-developers mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
The patch (loaded from CVS) seems to almost fix the issue but also another bug crept in.On Jun 29 11:47, Thomas Wolff wrote: > On 29.06.2012 11:24, Corinna Vinschen wrote: > >You know, we just love STCs. Send you small test program here, plus a > >short instruction how you created the clipboard content and how to call > >the testcase to see the problem. > Sure, so here it is. Open clipboard.txt with notepad, ^A^C to copy > all, then run the program to see bytes skipped. > Actually it seems to skip as many bytes per read() as there were > additional UTF-8 bytes (more bytes than characters) in the preceding > read block. > Checking the code again, variable pos seems to be used both as an > index into the clipboard (WCHAR) and an offset to the resulting > string length (char) which would explain the effect (not having > checked all the details though as I'm not familiar with the used > APIs).
Thanks for the testcase. I applied a patch which is supposed to fix the problem. It should be in the next developer snapshot. Please give it a try.
* I assume the current code will also fail in non-UTF-8 locales; if the wcs block being converted contains a non-convertible character, it would abort since wcstombs returns -1 (assuming here that sys_wcstombs behaves alike in this respect) and not even deliver the characters before the failing one.
------ Thomas
Attachment:
rcb.c
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |