From 18a34ccf77b8de4657e15da67c94061b02147ffc Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Sat, 2 May 1998 08:33:59 +0000 Subject: [PATCH] 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(-) diff --git a/contrib/bc/bc/main.c b/contrib/bc/bc/main.c index d2bbdfe29463..46f3c92bf2a1 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 70c8df6a4167..8b5b25dc142c 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)