Move definition of handler inside the #ifdef HAVE_READLINE
[pspp] / src / ui / terminal / terminal-reader.c
index 2f11279bf428af8b24a63902ef71f1db8bf83328..f0017cbb546a7ae63ef2ffebcd8c2d87793d8019 100644 (file)
@@ -99,7 +99,7 @@ welcome (void)
         "conditions.\nThere is ABSOLUTELY NO WARRANTY for PSPP; type \"show "
         "warranty.\" for details.\n", stdout);
   puts (stat_version);
-  journal_enable ();
+  journal_init ();
 }
 
 static struct terminal_reader *
@@ -108,12 +108,15 @@ terminal_reader_cast (struct lex_reader *r)
   return UP_CAST (r, struct terminal_reader, reader);
 }
 
+
 /* Older libreadline versions do not provide rl_outstream.
    However, it is almost always going to be the same as stdout. */
 #if ! HAVE_RL_OUTSTREAM
 # define rl_outstream stdout
 #endif
 
+
+#if HAVE_READLINE
 /* Similarly, rl_echo_signal_char is fairly recent.
    We provide our own crude version if it is not present. */
 #if ! HAVE_RL_ECHO_SIGNAL_CHAR
@@ -138,6 +141,7 @@ rl_echo_signal_char (int sig)
   fflush (rl_outstream);
 }  
 #endif
+#endif
 
 
 static size_t
@@ -252,15 +256,6 @@ readline_prompt (enum prompt_style style)
 static int pfd[2];
 static bool sigint_received ;
 
-static void 
-handler (int sig)
-{
-  rl_end = 0;
-
-  write (pfd[1], "x", 1);
-  rl_echo_signal_char (sig);
-}
-
 
 /* 
    A function similar to getc from stdio.
@@ -316,6 +311,16 @@ interruptible_getc (FILE *fp)
 
 #if HAVE_READLINE
 
+static void 
+handler (int sig)
+{
+  rl_end = 0;
+
+  write (pfd[1], "x", 1);
+  rl_echo_signal_char (sig);
+}
+
+
 static void
 readline_init (void)
 {