This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 4/5] Cygwin: pty: Add charset conversion for console apps in legacy PTY.
- From: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- To: cygwin-patches at cygwin dot com
- Cc: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- Date: Wed, 18 Sep 2019 23:29:20 +0900
- Subject: [PATCH 4/5] Cygwin: pty: Add charset conversion for console apps in legacy PTY.
- Dkim-filter: OpenDKIM Filter v2.10.3 conuserg-06.nifty.com x8IETKE1031962
- References: <20190918142921.835-1-takashi.yano@nifty.ne.jp>
---
winsup/cygwin/fhandler_tty.cc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index f723ec7cf..2a92e44cf 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -3054,6 +3054,12 @@ fhandler_pty_master::pty_master_fwd_thread ()
mb_str_free (buf);
continue;
}
+ size_t nlen;
+ char *buf = convert_mb_str
+ (get_ttyp ()->term_code_page, &nlen, GetConsoleOutputCP (), ptr, wlen);
+
+ ptr = buf;
+ wlen = rlen = nlen;
acquire_output_mutex (INFINITE);
while (rlen>0)
{
@@ -3066,6 +3072,7 @@ fhandler_pty_master::pty_master_fwd_thread ()
wlen = (rlen -= wlen);
}
release_output_mutex ();
+ mb_str_free (buf);
}
return 0;
}
--
2.21.0