summaryrefslogtreecommitdiffstats
path: root/bin/sh/var.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1999-04-03 11:41:46 +0000
committercracauer <cracauer@FreeBSD.org>1999-04-03 11:41:46 +0000
commitaffd55a23b9e3a35ceccf2ae330484d3cd15000d (patch)
tree7ff31bdd5007ab0b14f7470bd039e26095989e30 /bin/sh/var.c
parenta60072138b1bbfc03a9f8a531afefbd6993819e6 (diff)
downloadFreeBSD-src-affd55a23b9e3a35ceccf2ae330484d3cd15000d.zip
FreeBSD-src-affd55a23b9e3a35ceccf2ae330484d3cd15000d.tar.gz
Implement -a flag. A test shell script can be found at
http://www.cons.org/cracauer/download/sh-interrupt/testsuite/test_export.sh The PR also had test cases the new version passes. Fix typo in comment. PR: bin/1030
Diffstat (limited to 'bin/sh/var.c')
-rw-r--r--bin/sh/var.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c
index d1f2b76..9b9f0ee 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: var.c,v 1.12 1998/05/18 06:44:24 charnier Exp $";
#endif /* not lint */
#include <unistd.h>
@@ -218,7 +218,7 @@ setvarsafe(name, val, flags)
}
/*
- * Set the value of a variable. The flags argument is ored with the
+ * Set the value of a variable. The flags argument is stored with the
* flags of the variable. If val is NULL, the variable is unset.
*/
@@ -302,6 +302,8 @@ setvareq(s, flags)
{
struct var *vp, **vpp;
+ if (aflag)
+ flags |= VEXPORT;
vpp = hashvar(s);
for (vp = *vpp ; vp ; vp = vp->next) {
if (varequal(s, vp->text)) {
OpenPOWER on IntegriCloud