Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-06-04 18:59:47 +0400
committerCorinna Vinschen <corinna@vinschen.de>2009-06-04 18:59:47 +0400
commit7774a4b029225f4c2a0efb1a3109f148eb1b794d (patch)
treea5ed7cc8bad61c70139829b4b70167b847ae998b
parentf17f20c13900f4575412b831061733d2ef9dc699 (diff)
* fhandler_console.cc (set_console_title): Convert title string to
wchar_t and call SetConsoleTitleW.
-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 fe3d94572..4558c81fc 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 f3d26f40d..43f73597c 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