1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Remove a redundant file in utils.

At some point while setting up the utils subdirectory, I apparently
only got half way through renaming miscucs.c to dup_mb_to_wc.c: I
created the new copy of the file, but I didn't delete the old one, I
didn't mention it in utils/CMakeLists.txt, and I didn't change the
comment at the top.

Now done all three, so we now have just one copy of this utility
module.
This commit is contained in:
Simon Tatham 2021-11-30 18:48:06 +00:00
parent 1bbcde70ba
commit 7ab9a3f36d
3 changed files with 5 additions and 32 deletions

View File

@ -16,6 +16,7 @@ add_sources_from_current_dir(utils
dupcat.c
dupprintf.c
dupstr.c
dup_mb_to_wc.c
encode_utf8.c
encode_wide_string_as_utf8.c
fgetline.c
@ -28,7 +29,6 @@ add_sources_from_current_dir(utils
marshal.c
memory.c
memxor.c
miscucs.c
null_lp.c
nullseat.c
nullstrcmp.c

View File

@ -1,7 +1,8 @@
/*
* Centralised Unicode-related helper functions, separate from misc.c
* so that they can be omitted from tools that aren't including
* Unicode handling.
* dup_mb_to_wc: memory-allocating wrapper on mb_to_wc.
*
* Also dup_mb_to_wc_c: same but you already know the length of the
* string.
*/
#include "putty.h"

View File

@ -1,28 +0,0 @@
/*
* Centralised Unicode-related helper functions, separate from misc.c
* so that they can be omitted from tools that aren't including
* Unicode handling.
*/
#include "putty.h"
#include "misc.h"
wchar_t *dup_mb_to_wc_c(int codepage, int flags, const char *string, int len)
{
int mult;
for (mult = 1 ;; mult++) {
wchar_t *ret = snewn(mult*len + 2, wchar_t);
int outlen;
outlen = mb_to_wc(codepage, flags, string, len, ret, mult*len + 1);
if (outlen < mult*len+1) {
ret[outlen] = L'\0';
return ret;
}
sfree(ret);
}
}
wchar_t *dup_mb_to_wc(int codepage, int flags, const char *string)
{
return dup_mb_to_wc_c(codepage, flags, string, strlen(string));
}