OSDN Git Service

* Fix: -L* doesn't work.
[nkf/nkf.git] / nkf.c
diff --git a/nkf.c b/nkf.c
index b95c6b0..1d6387f 100644 (file)
--- a/nkf.c
+++ b/nkf.c
@@ -39,9 +39,9 @@
 **        E-Mail: furukawa@tcp-ip.or.jp
 **    \e$B$^$G8fO"Mm$r$*4j$$$7$^$9!#\e(B
 ***********************************************************************/
-/* $Id: nkf.c,v 1.126 2007/07/09 09:11:57 naruse Exp $ */
+/* $Id: nkf.c,v 1.127 2007/07/19 20:08:29 naruse Exp $ */
 #define NKF_VERSION "2.0.8"
-#define NKF_RELEASE_DATE "2007-07-09"
+#define NKF_RELEASE_DATE "2007-07-20"
 #include "config.h"
 #include "utf8tbl.h"
 
@@ -769,6 +769,7 @@ static char *get_backup_filename(const char *suffix, const char *filename);
 #endif
 
 static int             crmode_f = 0;   /* CR, NL, CRLF */
+static nkf_char prev_cr = 0;
 #ifdef EASYWIN /*Easy Win */
 static int             end_check;
 #endif /*Easy Win */
@@ -2939,8 +2940,10 @@ nkf_char kanji_convert(FILE *f)
                        SEND;
                    }
                }
-               if (crmode_f == CR && c1 == NL) crmode_f = CRLF;
-               else crmode_f = c1;
+               if (!crmode_f) {
+                   if (prev_cr && c1 == NL) crmode_f = CRLF;
+                   else crmode_f = c1;
+               }
            } else if (c1 == DEL && input_mode == X0208 ) {
                /* CP5022x */
                c2 = c1;
@@ -4354,8 +4357,6 @@ nkf_char broken_ungetc(nkf_char c, FILE *f)
     return c;
 }
 
-static nkf_char prev_cr = 0;
-
 void cr_conv(nkf_char c2, nkf_char c1)
 {
     if (prev_cr) {