summaryrefslogtreecommitdiff
path: root/bin/sh
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2019-01-20 14:25:25 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2019-01-20 14:25:25 +0000
commitf91d2e2171098e4ef5ed6c26272fae170b997078 (patch)
tree5ab6554572ee19cda2db599b00dd9dbfa4c5eb48 /bin/sh
parentdab61567aba0a3d992bba2488b4d03ad134feed5 (diff)
downloadsrc-test2-f91d2e2171098e4ef5ed6c26272fae170b997078.tar.gz
src-test2-f91d2e2171098e4ef5ed6c26272fae170b997078.zip
sh: Send libedit "ferr" output to fd 2
The libedit "fout" output must be sent to fd 2 since it contains prompts that POSIX says must be sent to fd 2. However, the libedit "ferr" output receives error messages such as from "bind" that make no sense to send to fd 1.
Notes
Notes: svn path=/head/; revision=343215
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/histedit.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
index 8e2f927cfe06..62f5a89a05e1 100644
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$");
History *hist; /* history cookie */
EditLine *el; /* editline cookie */
int displayhist;
-static FILE *el_in, *el_out, *el_err;
+static FILE *el_in, *el_out;
static char *fc_replace(const char *, char *, char *);
static int not_fcnumber(const char *);
@@ -106,18 +106,16 @@ histedit(void)
INTOFF;
if (el_in == NULL)
el_in = fdopen(0, "r");
- if (el_err == NULL)
- el_err = fdopen(1, "w");
if (el_out == NULL)
el_out = fdopen(2, "w");
- if (el_in == NULL || el_err == NULL || el_out == NULL)
+ if (el_in == NULL || el_out == NULL)
goto bad;
term = lookupvar("TERM");
if (term)
setenv("TERM", term, 1);
else
unsetenv("TERM");
- el = el_init(arg0, el_in, el_out, el_err);
+ el = el_init(arg0, el_in, el_out, el_out);
if (el != NULL) {
if (hist)
el_set(el, EL_HIST, history, hist);