From 966eca4ad87436d03e380eef1ca55f49d0aeedb4 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Tue, 2 May 2000 15:52:43 +0000 Subject: 11036, 11063, 11077: Always write the "read -q" prompt to shout; eliminate some redundant close() calls; relocate a misplaced redirection. --- Src/builtin.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index 7e536756a..508df9a4d 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3428,8 +3428,8 @@ bin_read(char *name, char **args, char *ops, int func) *readpmpt && *readpmpt != '?'; readpmpt++); if (*readpmpt++) { if (keys || isatty(0)) { - zputs(readpmpt, (haso ? shout : stderr)); - fflush(haso ? shout : stderr); + zputs(readpmpt, shout); + fflush(shout); } readpmpt[-1] = '\0'; } @@ -3469,8 +3469,7 @@ bin_read(char *name, char **args, char *ops, int func) else settyinfo(&shttyinfo); if (haso) { - close(SHTTY); - fclose(shout); + fclose(shout); /* close(SHTTY) */ shout = oshout; SHTTY = -1; } @@ -3502,8 +3501,7 @@ bin_read(char *name, char **args, char *ops, int func) /* dispose of result appropriately, etc. */ if (haso) { - close(SHTTY); - fclose(shout); + fclose(shout); /* close(SHTTY) */ shout = oshout; SHTTY = -1; } -- cgit 1.4.1