diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/df/df.c | 8 | ||||
-rw-r--r-- | bin/sh/var.c | 16 |
2 files changed, 17 insertions, 7 deletions
diff --git a/bin/df/df.c b/bin/df/df.c index 5420da9..f48c8c9 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 54a0a84..afb3c86 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; |