diff options
author | Christopher Faylor <me@cgf.cx> | 2002-06-26 09:29:41 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-06-26 09:29:41 +0400 |
commit | f279e522b05950655c6b4699ecd7a7f115261bc8 (patch) | |
tree | 9ef00309bf328db0d891c4078147d830d84375c4 /winsup/cygwin/fhandler_console.cc | |
parent | 109e4822783c39090bc4c1d3a0ff670ca56839bb (diff) |
* autoload (noload): Avoid clobbering bx register.
* environ.cc (codepage_init): Use case insensitive match.
* fhandler_console.cc (cp_get_internal): Delete.
(con_to_str): Use get_cp to derive code page.
(str_to_con): Ditto.
* miscfuncs.cc (get_cp): New function.
(sys_wcstombs): New function. Converted from macro.
(sys_mbstowcs): Ditto.
* winsup.h: Reflect above changes.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index cc948d3d0..458c5a337 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -17,7 +17,7 @@ details. */ #include <wingdi.h> #include <winuser.h> #include <wincon.h> -#include <winnls.h> // MultiByteToWideChar () and friends +#include <winnls.h> #include <ctype.h> #include <sys/cygwin.h> #include "cygerrno.h" @@ -32,16 +32,8 @@ details. */ #define CONVERT_LIMIT 4096 -/* The codepages are resolved here instead of using CP_ACP and - CP_OEMCP, so that they can later be compared for equality. */ -inline UINT -cp_get_internal () -{ - return current_codepage == ansi_cp ? GetACP() : GetOEMCP(); -} - static BOOL -cp_convert (UINT destcp, char * dest, UINT srccp, const char * src, DWORD size) +cp_convert (UINT destcp, char *dest, UINT srccp, const char *src, DWORD size) { if (!size) /* no action */; @@ -68,13 +60,13 @@ cp_convert (UINT destcp, char * dest, UINT srccp, const char * src, DWORD size) inline BOOL con_to_str (char *d, const char *s, DWORD sz) { - return cp_convert (cp_get_internal (), d, GetConsoleCP (), s, sz); + return cp_convert (get_cp (), d, GetConsoleCP (), s, sz); } inline BOOL str_to_con (char *d, const char *s, DWORD sz) { - return cp_convert (GetConsoleOutputCP (), d, cp_get_internal (), s, sz); + return cp_convert (GetConsoleOutputCP (), d, get_cp (), s, sz); } /* |