<br><br><div class="gmail_quote">On Wed, Mar 10, 2010 at 7:39 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
OMG, is the clipboard going to work in Linux now?<br></blockquote><div><br></div><div>:)  No :)  This is strictly windows.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
On Wed, Mar 10, 2010 at 1:22 PM,  &lt;<a href="mailto:commits@squeakvm.org">commits@squeakvm.org</a>&gt; wrote:<br>
&gt;<br>
&gt; Author: andreas<br>
&gt; Date: 2010-03-10 11:22:45 -0800 (Wed, 10 Mar 2010)<br>
&gt; New Revision: 2152<br>
&gt;<br>
&gt; Modified:<br>
&gt;   trunk/platforms/win32/vm/sqWin32Window.c<br>
&gt; Log:<br>
&gt; Add Eliot&#39;s clipboard handling fix.<br>
&gt;<br>
&gt; Modified: trunk/platforms/win32/vm/sqWin32Window.c<br>
&gt; ===================================================================<br>
&gt; --- trunk/platforms/win32/vm/sqWin32Window.c    2010-02-24 13:25:07 UTC (rev 2151)<br>
&gt; +++ trunk/platforms/win32/vm/sqWin32Window.c    2010-03-10 19:22:45 UTC (rev 2152)<br>
&gt; @@ -2353,7 +2353,6 @@<br>
&gt;  int clipboardSize(void) {<br>
&gt;   HANDLE h;<br>
&gt;   WCHAR *src;<br>
&gt; -  unsigned char *tmp;<br>
&gt;   int i, count, bytesNeeded;<br>
&gt;<br>
&gt;   /* Do we have text in the clipboard? */<br>
&gt; @@ -2370,18 +2369,20 @@<br>
&gt;   /* How many bytes do we need to store those unicode chars in UTF8 format? */<br>
&gt;   bytesNeeded = WideCharToMultiByte(CP_UTF8, 0, src, -1,<br>
&gt;                                    NULL, 0, NULL, NULL );<br>
&gt; -  tmp = malloc(bytesNeeded+1);<br>
&gt; +  if (bytesNeeded &gt; 0) {<br>
&gt; +    unsigned char *tmp = malloc(bytesNeeded+1);<br>
&gt;<br>
&gt; -  /* Convert Unicode text to UTF8. */<br>
&gt; -  WideCharToMultiByte(CP_UTF8, 0, src, -1, tmp, bytesNeeded , NULL, NULL);<br>
&gt; +    /* Convert Unicode text to UTF8. */<br>
&gt; +    WideCharToMultiByte(CP_UTF8, 0, src, -1, tmp, bytesNeeded , NULL, NULL);<br>
&gt;<br>
&gt; -  /* Count CrLfs for which we remove the extra Lf */<br>
&gt; -  count = bytesNeeded; /* ex. terminating zero */<br>
&gt; -  for(i=0; i&lt;count; i++) {<br>
&gt; -    if((tmp[i] == 13) &amp;&amp; (tmp[i+1] == 10)) bytesNeeded--;<br>
&gt; +    /* Count CrLfs for which we remove the extra Lf */<br>
&gt; +    count = bytesNeeded; /* ex. terminating zero */<br>
&gt; +    for(i=0; i&lt;count; i++) {<br>
&gt; +      if((tmp[i] == 13) &amp;&amp; (tmp[i+1] == 10)) bytesNeeded--;<br>
&gt; +    }<br>
&gt; +    bytesNeeded--; /* discount terminating zero */<br>
&gt; +    free(tmp); /* no longer needed */<br>
&gt;   }<br>
&gt; -  bytesNeeded--; /* discount terminating zero */<br>
&gt; -  free(tmp); /* no longer needed */<br>
&gt;<br>
&gt;   GlobalUnlock(h);<br>
&gt;   CloseClipboard();<br>
&gt;<br>
&gt;<br>
</blockquote></div><br>