aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_console.cc9
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