OSDN Git Service

* (reinit): should initialize all static variables. [ruby-list:40445]
[nkf/nkf.git] / nkf.c
diff --git a/nkf.c b/nkf.c
index 5f56527..e620549 100644 (file)
--- a/nkf.c
+++ b/nkf.c
@@ -39,7 +39,7 @@
 **        E-Mail: furukawa@tcp-ip.or.jp
 **    \e$B$^$G8fO"Mm$r$*4j$$$7$^$9!#\e(B
 ***********************************************************************/
 **        E-Mail: furukawa@tcp-ip.or.jp
 **    \e$B$^$G8fO"Mm$r$*4j$$$7$^$9!#\e(B
 ***********************************************************************/
-/* $Id: nkf.c,v 1.54 2005/01/02 05:46:01 naruse Exp $ */
+/* $Id: nkf.c,v 1.55 2005/01/24 08:19:34 naruse Exp $ */
 #define NKF_VERSION "2.0.4"
 #define NKF_RELEASE_DATE "2005-01-01"
 #include "config.h"
 #define NKF_VERSION "2.0.4"
 #define NKF_RELEASE_DATE "2005-01-01"
 #include "config.h"
@@ -1322,6 +1322,10 @@ struct input_code * find_inputcode_byfunc(iconv_func)
     return 0;
 }
 
     return 0;
 }
 
+#ifdef CHECK_OPTION
+static int (*iconv_for_check)() = 0;
+#endif
+
 #ifdef ANSI_C_PROTOTYPE
 void set_iconv(int f, int (*iconv_func)(int c2,int c1,int c0))
 #else
 #ifdef ANSI_C_PROTOTYPE
 void set_iconv(int f, int (*iconv_func)(int c2,int c1,int c0))
 #else
@@ -1330,9 +1334,6 @@ void set_iconv(f, iconv_func)
      int (*iconv_func)();
 #endif
 {
      int (*iconv_func)();
 #endif
 {
-#ifdef CHECK_OPTION
-    static int (*iconv_for_check)() = 0;
-#endif
 #ifdef INPUT_CODE_FIX
     if (f || !input_f)
 #endif
 #ifdef INPUT_CODE_FIX
     if (f || !input_f)
 #endif
@@ -4556,7 +4557,9 @@ reinit()
     broken_counter = 0;
     broken_last = 0;
     z_prev2=0,z_prev1=0;
     broken_counter = 0;
     broken_last = 0;
     z_prev2=0,z_prev1=0;
-
+#ifdef CHECK_OPTION
+    iconv_for_check = 0;
+#endif
 }
 #endif
 
 }
 #endif