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>2008-02-25 21:32:23 +0300
committerCorinna Vinschen <corinna@vinschen.de>2008-02-25 21:32:23 +0300
commit5ab0b5cf529c3f069264b469db4aacbcb95ce760 (patch)
tree0800401dfb684fc09dbafeb0b74319e970bd4fa0 /winsup/cygwin/fhandler_clipboard.cc
parentff42f5b1e35d7c605288680b6f7de02d675143b7 (diff)
* dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING is
enabled. Replace calls to GetEnvironmentVariable by calls to GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA with NULL buffer. (cygbench): Ditto, drop local buffer. * environ.cc (getearly): Call GetEnvironmentVariableA. (environ_init): Retrieve unicode environment and convert to current codepage locally. (getwinenveq): Ditto. * exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling convention. * fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve required buffer length. * fork.cc (frok::child): Call GetEnvironmentVariableA. * miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs. * sec_auth.cc: Ditto. * strfuncs.cc (sys_wcstombs_alloc): Fix formatting. (sys_mbstowcs): Change arguments to allow specifying a source string length. (sys_mbstowcs_alloc): Ditto. * uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in calls to sys_mbstowcs. * winsup.h (sys_mbstowcs): Adjust declaration. (sys_mbstowcs_alloc): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_clipboard.cc')
-rw-r--r--winsup/cygwin/fhandler_clipboard.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc
index 847dedb3c..b5d6b3e8a 100644
--- a/winsup/cygwin/fhandler_clipboard.cc
+++ b/winsup/cygwin/fhandler_clipboard.cc
@@ -121,7 +121,7 @@ set_clipboard (const void *buf, size_t len)
OpenClipboard (0);
- len = MultiByteToWideChar (get_cp (), 0, (const char *) buf, len, NULL, 0);
+ len = sys_mbstowcs (NULL, 0, (const char *) buf, len);
if (!len)
{
system_printf ("Invalid string");
@@ -134,7 +134,7 @@ set_clipboard (const void *buf, size_t len)
return -1;
}
clipbuf = GlobalLock (hmem);
- sys_mbstowcs ((PWCHAR) clipbuf, (const char *) buf, len);
+ sys_mbstowcs ((PWCHAR) clipbuf, len, (const char *) buf);
*((PWCHAR) clipbuf + len) = L'\0';
GlobalUnlock (hmem);
if (!SetClipboardData (CF_UNICODETEXT, hmem))