1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-18 11:31:00 -05:00

dup_mb_to_wc, dup_wc_to_mb: remove the 'flags' parameter.

This parameter was undocumented, and Windows-specific: its semantics
date from before PuTTY was cross-platform, and are "Pass this flags
parameter straight through to the Win32 API's conversion functions".
So in Windows platform code you can pass flags like MB_USEGLYPHCHARS,
but in cross-platform code, you dare not pass anything nonzero at all
because the Unix frontend won't recognise it (or, likely, even
compile).

I've kept the flag for now in the underlying mb_to_wc / wc_to_mb
functions. Partly that's because there's one place in the Windows code
where the parameter _is_ used; mostly, it's because I'm about to
replace those functions anyway, so there's no point in editing all the
call sites twice.
This commit is contained in:
Simon Tatham
2024-09-24 08:46:39 +01:00
parent ed621590b0
commit c4c4d2c5cb
10 changed files with 31 additions and 32 deletions

8
misc.h
View File

@ -71,12 +71,12 @@ void strbuf_finalise_agent_query(strbuf *buf);
/* String-to-Unicode converters that auto-allocate the destination and
* work around the rather deficient interface of mb_to_wc. */
wchar_t *dup_mb_to_wc_c(int codepage, int flags, const char *string,
wchar_t *dup_mb_to_wc_c(int codepage, const char *string,
size_t len, size_t *outlen_p);
wchar_t *dup_mb_to_wc(int codepage, int flags, const char *string);
char *dup_wc_to_mb_c(int codepage, int flags, const wchar_t *string,
wchar_t *dup_mb_to_wc(int codepage, const char *string);
char *dup_wc_to_mb_c(int codepage, const wchar_t *string,
size_t len, const char *defchr, size_t *outlen_p);
char *dup_wc_to_mb(int codepage, int flags, const wchar_t *string,
char *dup_wc_to_mb(int codepage, const wchar_t *string,
const char *defchr);
static inline int toint(unsigned u)