Jon Turney wrote:
On 21/11/2021 10:36, Mark Geisert wrote:
Hi Denis,

Denis Excoffier wrote:
Hello,

On 2021-11-03 10:59, Mark Geisert wrote:

The following packages have been uploaded to the Cygwin distribution:

* cygutils-1.4.16-8
* cygutils-extra-1.4.16-8
* cygutils-x11-1.4.16-8


The '-u' or '-d' option of getclip does not seem to work properly under xterm.
How to reproduce:
1) Open an xterm
2) Select a simple piece of text (with no line ending)
3) getclip -u
4) Observe 'Segmentation fault(core dumped)'

If step 2 is replaced by ‘printf AAAA | putclip', no error.
If step 3 is replaced by ‘getclip’, no error.

I can’t tell whether this is new or not.

It appears to be old.  An xterm selection is placed on the Windows clipboard in CF_UNICODETEXT format.  'getclip' can deal with this, 'getclip -u' and 'getclip -d' cannot; they always request CF_TEXT (i.e., ANSI) format and assume they get a buffer of data.  But the formats don't match and there's no data supplied. That's why the segfault occurs.

Odd... I think that Windows should convert CF_UNICODETEXT to CF_TEXT if needed

See https://docs.microsoft.com/en-gb/windows/win32/dataxchg/clipboard-formats#synthesized-clipboard-formats

I did notice that doc when I was updating getclip and putclip. I wondered why that conversion didn't seem to be happening in the testcases and whether that was a Windows change over time. I had no answer.

What surprised me about the segfault was that GetClipboardData(CF_TEXT) was returning zero, the error indication, but a subsequent GetLastError() returned zero as well, so no specific error.

..mark

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to