Updated for version YAZ 1.6 and higher.
[egate.git] / util / ttyemit.c
index 7efa1e3..dcebd8b 100644 (file)
@@ -45,6 +45,9 @@
  * Europagate, 1995
  *
  * $Log: ttyemit.c,v $
+ * Revision 1.3  2001/02/26 10:35:40  adam
+ * Updated for version YAZ 1.6 and higher.
+ *
  * Revision 1.2  1995/05/16 09:40:55  adam
  * LICENSE.
  *
@@ -65,7 +68,7 @@ static int  esc_flag = 0;
 
 static int  line_min = 30;
 static int  line_max = 76;
-static FILE *out_f = stdout;
+static FILE *out_f = 0;
 
 void tty_init (FILE *out, int min, int max)
 {
@@ -82,6 +85,8 @@ static void flush (void)
 {
     int j;
 
+    if (!out_f)
+        out_f = stdout;
     for (j = 0; j<line_col; j++)
         putc (line_buf[j], out_f);
     putc ('\n', out_f);
@@ -92,6 +97,8 @@ static void split (int ch)
 {
     int i = line_col, j;
 
+    if (!out_f)
+        out_f = stdout;
     while (1)
         if (line_buf[--i] == ' ')
         {