diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-06-04 14:59:47 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-06-04 14:59:47 +0000 |
commit | 7774a4b029225f4c2a0efb1a3109f148eb1b794d (patch) | |
tree | a5ed7cc8bad61c70139829b4b70167b847ae998b /winsup | |
parent | f17f20c13900f4575412b831061733d2ef9dc699 (diff) | |
download | newlib-7774a4b029225f4c2a0efb1a3109f148eb1b794d.zip newlib-7774a4b029225f4c2a0efb1a3109f148eb1b794d.tar.gz newlib-7774a4b029225f4c2a0efb1a3109f148eb1b794d.tar.bz2 |
* fhandler_console.cc (set_console_title): Convert title string to
wchar_t and call SetConsoleTitleW.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fe3d945..4558c81 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2009-06-04 Corinna Vinschen <corinna@vinschen.de> + * fhandler_console.cc (set_console_title): Convert title string to + wchar_t and call SetConsoleTitleW. + +2009-06-04 Corinna Vinschen <corinna@vinschen.de> + * fhandler_console.cc (fhandler_console::read): Allow Ctrl-Space to emit a NUL byte. diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index f3d26f4..43f7359 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1892,12 +1892,11 @@ fhandler_console::set_close_on_exec (bool val) void __stdcall set_console_title (char *title) { - char buf[257]; - strncpy (buf, title, sizeof (buf) - 1); - buf[sizeof (buf) - 1] = '\0'; + wchar_t buf[257]; + sys_mbstowcs (buf, sizeof buf, title); lock_ttys here (15000); - SetConsoleTitle (buf); - debug_printf ("title '%s'", buf); + SetConsoleTitleW (buf); + debug_printf ("title '%W'", buf); } void |