summaryrefslogtreecommitdiffstats
path: root/bin/sh/var.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2007-05-01 16:02:44 +0000
committerache <ache@FreeBSD.org>2007-05-01 16:02:44 +0000
commit6ccaf050cc62bc9d81ac3acb71ce640739caa0f7 (patch)
treee3e0b3658b8df3a905b3117d8535bb15f42c9e80 /bin/sh/var.c
parent61e9800ad7707590037d6868c703475f36cf7058 (diff)
downloadFreeBSD-src-6ccaf050cc62bc9d81ac3acb71ce640739caa0f7.zip
FreeBSD-src-6ccaf050cc62bc9d81ac3acb71ce640739caa0f7.tar.gz
Back out all POSIXified *env() changes.
Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that. Anyone who interested in POSIX can dig out what changes and how through cvs diffs.
Diffstat (limited to 'bin/sh/var.c')
-rw-r--r--bin/sh/var.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c
index afb144a..54a0a84 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -319,7 +319,7 @@ setvareq(char *s, int flags)
if (vp == &vmpath || (vp == &vmail && ! mpathset()))
chkmail(1);
if ((vp->flags & VEXPORT) && localevar(s)) {
- (void) putenv(savestr(s));
+ putenv(s);
(void) setlocale(LC_ALL, "");
}
INTON;
@@ -335,7 +335,7 @@ setvareq(char *s, int flags)
INTOFF;
*vpp = vp;
if ((vp->flags & VEXPORT) && localevar(s)) {
- (void) putenv(savestr(s));
+ putenv(s);
(void) setlocale(LC_ALL, "");
}
INTON;
@@ -596,7 +596,7 @@ exportcmd(int argc, char **argv)
vp->flags |= flag;
if ((vp->flags & VEXPORT) && localevar(vp->text)) {
- (void) putenv(savestr(vp->text));
+ putenv(vp->text);
(void) setlocale(LC_ALL, "");
}
goto found;
@@ -776,7 +776,6 @@ unsetcmd(int argc __unused, char **argv __unused)
int
unsetvar(char *s)
{
- char *eqp, *ss;
struct var **vpp;
struct var *vp;
@@ -789,11 +788,7 @@ unsetvar(char *s)
if (*(strchr(vp->text, '=') + 1) != '\0')
setvar(s, nullstr, 0);
if ((vp->flags & VEXPORT) && localevar(vp->text)) {
- ss = savestr(s);
- if ((eqp = strchr(ss, '=')) != NULL)
- *eqp = '\0';
- (void) unsetenv(ss);
- ckfree(ss);
+ unsetenv(s);
setlocale(LC_ALL, "");
}
vp->flags &= ~VEXPORT;
OpenPOWER on IntegriCloud