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:
@ -9,14 +9,14 @@
|
||||
#include "putty.h"
|
||||
#include "misc.h"
|
||||
|
||||
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 inlen, size_t *outlen_p)
|
||||
{
|
||||
assert(inlen <= INT_MAX);
|
||||
size_t mult;
|
||||
for (mult = 1 ;; mult++) {
|
||||
wchar_t *ret = snewn(mult*inlen + 2, wchar_t);
|
||||
size_t outlen = mb_to_wc(codepage, flags, string, inlen, ret,
|
||||
size_t outlen = mb_to_wc(codepage, 0, string, inlen, ret,
|
||||
mult*inlen + 1);
|
||||
if (outlen < mult*inlen+1) {
|
||||
if (outlen_p)
|
||||
@ -28,7 +28,7 @@ wchar_t *dup_mb_to_wc_c(int codepage, int flags, const char *string,
|
||||
}
|
||||
}
|
||||
|
||||
wchar_t *dup_mb_to_wc(int codepage, int flags, const char *string)
|
||||
wchar_t *dup_mb_to_wc(int codepage, const char *string)
|
||||
{
|
||||
return dup_mb_to_wc_c(codepage, flags, string, strlen(string), NULL);
|
||||
return dup_mb_to_wc_c(codepage, string, strlen(string), NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user