Cygwin: pty: Change the timing of set_locale() call again.

- After commit 095972ce5b, charset
  conversion in mintty is broken if charset is set to other than
  UTF-8. This seems to be caused because mintty does not set locale
  yet at fork() call. This patch changes the timing of set_locale()
  call again to avoid this issue.
This commit is contained in:
Takashi Yano via Cygwin-patches
2020-08-15 12:23:52 +09:00
committed by Corinna Vinschen
parent 095972ce5b
commit 70d02aaca6
2 changed files with 18 additions and 4 deletions

View File

@@ -2852,6 +2852,9 @@ get_langinfo (char *locale_out, char *charset_out)
void
fhandler_pty_slave::setup_locale (void)
{
if (get_ttyp ()->term_code_page != 0)
return;
char locale[ENCODING_LEN + 1] = "C";
char charset[ENCODING_LEN + 1] = "ASCII";
LCID lcid = get_langinfo (locale, charset);
@@ -2983,10 +2986,6 @@ fhandler_pty_slave::fixup_after_fork (HANDLE parent)
// fork_fixup (parent, inuse, "inuse");
// fhandler_pty_common::fixup_after_fork (parent);
report_tty_counts (this, "inherited", "");
/* Set locale */
if (get_ttyp ()->term_code_page == 0)
setup_locale ();
}
void
@@ -3024,6 +3023,9 @@ fhandler_pty_slave::fixup_after_exec ()
}
}
/* Set locale */
setup_locale ();
/* Hook Console API */
if (get_pseudo_console ())
{