diff options
author | ache <ache@FreeBSD.org> | 1998-05-02 08:33:59 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1998-05-02 08:33:59 +0000 |
commit | c8a064d4002b5c8ccd5b2dc2e8b2c91eaa958fc8 (patch) | |
tree | ad466c8ff4c2a32f2100879c3fbf9d11f78e353a /contrib/bc | |
parent | d1eb14c5f66e207535661f4c20a89ed6e8fbc648 (diff) | |
download | FreeBSD-src-c8a064d4002b5c8ccd5b2dc2e8b2c91eaa958fc8.zip FreeBSD-src-c8a064d4002b5c8ccd5b2dc2e8b2c91eaa958fc8.tar.gz |
Back out complex and semi-correct workaround and commit one line fix
for 'echo' problem instead
Diffstat (limited to 'contrib/bc')
-rw-r--r-- | contrib/bc/bc/main.c | 10 | ||||
-rw-r--r-- | 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 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) |