On Feb 20 14:35, Corinna Vinschen wrote: > On Feb 20 20:51, Takashi Yano wrote: > > - In xterm compatible mode, 0x00 on write() behaves incompatible > > with real xterm. In xterm, 0x00 completely ignored. Therefore, > > 0x00 is ignored by console with this patch. > > --- > > winsup/cygwin/fhandler_console.cc | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > [...] > > Counter-proposal: > > diff --git a/winsup/cygwin/fhandler_console.cc > b/winsup/cygwin/fhandler_console.cc > index 66e645aa1774..1b3aa0f34aa6 100644 > --- a/winsup/cygwin/fhandler_console.cc > +++ b/winsup/cygwin/fhandler_console.cc > [...]
Btw., I tested this with write (1, "A\0B\0C\0D", 7); it turned out that this results in broken output even with your patch. The reason is that a NUL byte must not (cannot) be evaluated by dev_console::str_to_con() -> sys_cp_mbstowcs(). The latter doesn't handle embedded NUL bytes gracefully. Corinna -- Corinna Vinschen Cygwin Maintainer
signature.asc
Description: PGP signature
