Another fix from Hung-Te Lin; apparently in some IMEs (such as
[u/mdw/putty] / wcwidth.c
index f76fd86..403010b 100644 (file)
--- a/wcwidth.c
+++ b/wcwidth.c
@@ -6,7 +6,9 @@
  * Markus Kuhn -- 2001-01-12 -- public domain
  */
 
-#include <wchar.h>
+#include <stddef.h>
+
+#include "putty.h"
 
 struct interval {
   unsigned short first;
@@ -144,7 +146,6 @@ int wcswidth(const wchar_t *pwcs, size_t n)
   return width;
 }
 
-#if 0 /* RDB: we don't need the cjk version */
 /*
  * The following function is the same as wcwidth(), except that
  * spacing characters in the East Asian Ambiguous (A) category as
@@ -153,7 +154,7 @@ int wcswidth(const wchar_t *pwcs, size_t n)
  * encodings who want to migrate to UCS. It is not otherwise
  * recommended for general use.
  */
-static int wcwidth_cjk(wchar_t ucs)
+int wcwidth_cjk(wchar_t ucs)
 {
   /* sorted list of non-overlapping intervals of East Asian Ambiguous
    * characters */
@@ -231,4 +232,3 @@ int wcswidth_cjk(const wchar_t *pwcs, size_t n)
 
   return width;
 }
-#endif