From 8ef0e968de826a09c901f5bb90f32c68518fba0d Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Tue, 17 Jan 2006 15:06:26 +0000 Subject: [PATCH] Add forgotten part of setenv cleanup Submitted-by: Alexey Slynko --- bin/sh/histedit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index bb151247cf..5fa910f54a 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -35,7 +35,7 @@ * * @(#)histedit.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/bin/sh/histedit.c,v 1.13.2.4 2002/08/27 01:36:28 tjr Exp $ - * $DragonFly: src/bin/sh/histedit.c,v 1.6 2005/11/13 11:58:30 corecode Exp $ + * $DragonFly: src/bin/sh/histedit.c,v 1.7 2006/01/17 15:06:26 corecode Exp $ */ #include @@ -110,8 +110,10 @@ histedit(void) goto bad; el_err = el_out; term = lookupvar("TERM"); - if (term) - setenv("TERM", term, 1); + if (term) { + if (setenv("TERM", term, 1) == -1) + error("setenv: cannot set TERM=1"); + } else unsetenv("TERM"); shname = arg0; -- 2.41.0