public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pty: Add charset conversion for console apps in legacy PTY.
@ 2019-09-20 21:59 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-09-20 21:59 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b757a21d857608d800529149b1f05192a0d2d0f6

commit b757a21d857608d800529149b1f05192a0d2d0f6
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Wed Sep 18 23:29:20 2019 +0900

    Cygwin: pty: Add charset conversion for console apps in legacy PTY.

Diff:
---
 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 f723ec7..2a92e44 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;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-20 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 21:59 [newlib-cygwin] Cygwin: pty: Add charset conversion for console apps in legacy PTY Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).