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:
parent
1bbcde70ba
commit
7ab9a3f36d
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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));
|
||||
}
|
Loading…
Reference in New Issue
Block a user