From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28446 invoked by alias); 2 Jul 2012 20:40:45 -0000 Received: (qmail 26640 invoked by uid 22791); 2 Jul 2012 20:40:18 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Mon, 02 Jul 2012 20:39:48 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id A404C2C0076; Mon, 2 Jul 2012 22:30:36 +0200 (CEST) Date: Mon, 02 Jul 2012 20:40:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: /dev/clipboard corrupted Message-ID: <20120702203036.GD20942@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <1286377403.634959.1340961856516.JavaMail.open-xchange@email.1und1.de> <4FED79A6.6050401@towo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4FED79A6.6050401@towo.net> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-07/txt/msg00023.txt.bz2 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. Thanks, Corinna -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple