Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jan 2019 14:25:25 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343215 - head/bin/sh
Message-ID:  <201901201425.x0KEPPEU029393@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sun Jan 20 14:25:25 2019
New Revision: 343215
URL: https://svnweb.freebsd.org/changeset/base/343215

Log:
  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.

Modified:
  head/bin/sh/histedit.c

Modified: head/bin/sh/histedit.c
==============================================================================
--- head/bin/sh/histedit.c	Sun Jan 20 14:02:54 2019	(r343214)
+++ head/bin/sh/histedit.c	Sun Jan 20 14:25:25 2019	(r343215)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901201425.x0KEPPEU029393>