Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2021-11-30 21:48:06 +0300
committerSimon Tatham <anakin@pobox.com>2021-11-30 21:48:06 +0300
commit7ab9a3f36d0736de43bbd3e8bb3a132816b5055c (patch)
treed2cdb48b69d22af29d5d557eb8cc6a6c05e620fc /utils
parent1bbcde70ba11dd205cc9324a6e3aad169b75a6bf (diff)
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.
Diffstat (limited to 'utils')
-rw-r--r--utils/CMakeLists.txt2
-rw-r--r--utils/dup_mb_to_wc.c7
-rw-r--r--utils/miscucs.c28
3 files changed, 5 insertions, 32 deletions
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 73e120db..86f48952 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -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
diff --git a/utils/dup_mb_to_wc.c b/utils/dup_mb_to_wc.c
index 7785f9b6..c3f17aba 100644
--- a/utils/dup_mb_to_wc.c
+++ b/utils/dup_mb_to_wc.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"
diff --git a/utils/miscucs.c b/utils/miscucs.c
deleted file mode 100644
index 7785f9b6..00000000
--- a/utils/miscucs.c
+++ /dev/null
@@ -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));
-}