From c8a064d4002b5c8ccd5b2dc2e8b2c91eaa958fc8 Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 2 May 1998 08:33:59 +0000 Subject: Back out complex and semi-correct workaround and commit one line fix for 'echo' problem instead --- contrib/bc/bc/main.c | 10 ++++------ contrib/bc/bc/scan.l | 5 ++--- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'contrib/bc') diff --git a/contrib/bc/bc/main.c b/contrib/bc/bc/main.c index d2bbdfe..46f3c92 100644 --- a/contrib/bc/bc/main.c +++ b/contrib/bc/bc/main.c @@ -137,19 +137,16 @@ main (argc, argv) char *env_value; char *env_argv[30]; int env_argc; - extern FILE *rl_outstream; /* Initialize many variables. */ compile_only = FALSE; use_math = FALSE; warn_not_std = FALSE; std_only = FALSE; - if (isatty(0) && isatty(1)) + if (isatty(0) && isatty(1)) interactive = TRUE; - else { + else interactive = FALSE; - rl_outstream = stderr; - } quiet = FALSE; file_names = NULL; @@ -214,7 +211,8 @@ main (argc, argv) #ifdef READLINE /* Readline support. Set both application name and input file. */ rl_readline_name = "bc"; - rl_instream = stdin; + if (interactive) + rl_instream = stdin; using_history (); #endif diff --git a/contrib/bc/bc/scan.l b/contrib/bc/bc/scan.l index 70c8df6..8b5b25d 100644 --- a/contrib/bc/bc/scan.l +++ b/contrib/bc/bc/scan.l @@ -63,7 +63,6 @@ static char *rl_start = (char *)NULL; static char rl_len = 0; /* Definitions for readline access. */ -extern FILE *rl_outstream; extern FILE *rl_instream; _PROTOTYPE(char *readline, (char *)); @@ -108,8 +107,8 @@ rl_input (buf, result, max) if (rl_len != 1) add_history (rl_line); rl_line[rl_len-1] = '\n'; - fprintf (rl_outstream,"\r"); - fflush (rl_outstream); + printf ("\r"); + fflush (stdout); } if (rl_len <= max) -- cgit v1.1