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/miscfuncs.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/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 4f19b2f53..e92480f53 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -116,10 +116,10 @@ cygwin_strcasecmp (const char *cs, const char *ct)
len = (strlen (cs) + 1) * sizeof (WCHAR);
RtlInitEmptyUnicodeString (&us, (PWCHAR) alloca (len), len);
- us.Length = sys_mbstowcs (us.Buffer, cs, us.MaximumLength) * sizeof (WCHAR);
+ us.Length = sys_mbstowcs (us.Buffer, us.MaximumLength, cs) * sizeof (WCHAR);
len = (strlen (ct) + 1) * sizeof (WCHAR);
RtlInitEmptyUnicodeString (&ut, (PWCHAR) alloca (len), len);
- ut.Length = sys_mbstowcs (ut.Buffer, ct, ut.MaximumLength) * sizeof (WCHAR);
+ ut.Length = sys_mbstowcs (ut.Buffer, ut.MaximumLength, ct) * sizeof (WCHAR);
return RtlCompareUnicodeString (&us, &ut, TRUE);
}
@@ -134,14 +134,14 @@ cygwin_strncasecmp (const char *cs, const char *ct, size_t n)
++ls;
len = ls * sizeof (WCHAR);
RtlInitEmptyUnicodeString (&us, (PWCHAR) alloca (len), len);
- us.Length = MultiByteToWideChar (get_cp (), 0, cs, ls, us.Buffer,
- us.MaximumLength) * sizeof (WCHAR);
+ us.Length = sys_mbstowcs (us.Buffer, us.MaximumLength / sizeof (WCHAR),
+ cs, ls) * sizeof (WCHAR);
while (ct[lt] && lt < n)
++lt;
len = lt * sizeof (WCHAR);
RtlInitEmptyUnicodeString (&ut, (PWCHAR) alloca (len), len);
- ut.Length = MultiByteToWideChar (get_cp (), 0, ct, lt, ut.Buffer,
- ut.MaximumLength) * sizeof (WCHAR);
+ ut.Length = sys_mbstowcs (ut.Buffer, ut.MaximumLength / sizeof (WCHAR),
+ ct, lt) * sizeof (WCHAR);
return RtlCompareUnicodeString (&us, &ut, TRUE);
}
@@ -172,7 +172,7 @@ cygwin_strlwr (char *string)
size_t len = (strlen (string) + 1) * sizeof (WCHAR);
us.MaximumLength = len; us.Buffer = (PWCHAR) alloca (len);
- us.Length = sys_mbstowcs (us.Buffer, string, len) * sizeof (WCHAR)
+ us.Length = sys_mbstowcs (us.Buffer, len, string) * sizeof (WCHAR)
- sizeof (WCHAR);
RtlDowncaseUnicodeString (&us, &us, FALSE);
sys_wcstombs (string, len / sizeof (WCHAR), us.Buffer);
@@ -186,7 +186,7 @@ cygwin_strupr (char *string)
size_t len = (strlen (string) + 1) * sizeof (WCHAR);
us.MaximumLength = len; us.Buffer = (PWCHAR) alloca (len);
- us.Length = sys_mbstowcs (us.Buffer, string, len) * sizeof (WCHAR)
+ us.Length = sys_mbstowcs (us.Buffer, len, string) * sizeof (WCHAR)
- sizeof (WCHAR);
RtlUpcaseUnicodeString (&us, &us, FALSE);
sys_wcstombs (string, len / sizeof (WCHAR), us.Buffer);