summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSean Farley <scf@FreeBSD.org>2007-07-04 00:00:41 +0000
committerSean Farley <scf@FreeBSD.org>2007-07-04 00:00:41 +0000
commit2966d28c322dcfa4b9db2558da0b91839e7798b9 (patch)
tree423c7d016f87f6541b9ef8231a14f8b267bc5d5e /bin
parentf6c1ecca50279edac3eb930eecd72ff23bfd85dc (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/df/df.c8
-rw-r--r--bin/sh/var.c16
2 files changed, 17 insertions, 7 deletions
diff --git a/bin/df/df.c b/bin/df/df.c
index 5420da92500e..f48c8c95e841 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -131,14 +131,14 @@ main(int argc, char *argv[])
*/
if (kflag)
break;
- putenv("BLOCKSIZE=512");
+ setenv("BLOCKSIZE", "512", 1);
hflag = 0;
break;
case 'c':
cflag = 1;
break;
case 'g':
- putenv("BLOCKSIZE=1g");
+ setenv("BLOCKSIZE", "1g", 1);
hflag = 0;
break;
case 'H':
@@ -152,7 +152,7 @@ main(int argc, char *argv[])
break;
case 'k':
kflag++;
- putenv("BLOCKSIZE=1024");
+ setenv("BLOCKSIZE", "1024", 1);
hflag = 0;
break;
case 'l':
@@ -162,7 +162,7 @@ main(int argc, char *argv[])
lflag = 1;
break;
case 'm':
- putenv("BLOCKSIZE=1m");
+ setenv("BLOCKSIZE", "1m", 1);
hflag = 0;
break;
case 'n':
diff --git a/bin/sh/var.c b/bin/sh/var.c
index 54a0a84080c3..afb3c862e653 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -289,6 +289,7 @@ void
setvareq(char *s, int flags)
{
struct var *vp, **vpp;
+ char *p;
int len;
if (aflag)
@@ -319,7 +320,10 @@ setvareq(char *s, int flags)
if (vp == &vmpath || (vp == &vmail && ! mpathset()))
chkmail(1);
if ((vp->flags & VEXPORT) && localevar(s)) {
- putenv(s);
+ p = strchr(s, '=');
+ *p = '\0';
+ (void) setenv(s, p + 1, 1);
+ *p = '=';
(void) setlocale(LC_ALL, "");
}
INTON;
@@ -335,7 +339,10 @@ setvareq(char *s, int flags)
INTOFF;
*vpp = vp;
if ((vp->flags & VEXPORT) && localevar(s)) {
- putenv(s);
+ p = strchr(s, '=');
+ *p = '\0';
+ (void) setenv(s, p + 1, 1);
+ *p = '=';
(void) setlocale(LC_ALL, "");
}
INTON;
@@ -596,7 +603,10 @@ exportcmd(int argc, char **argv)
vp->flags |= flag;
if ((vp->flags & VEXPORT) && localevar(vp->text)) {
- putenv(vp->text);
+ p = strchr(vp->text, '=');
+ *p = '\0';
+ (void) setenv(vp->text, p + 1, 1);
+ *p = '=';
(void) setlocale(LC_ALL, "");
}
goto found;