From affd55a23b9e3a35ceccf2ae330484d3cd15000d Mon Sep 17 00:00:00 2001 From: cracauer Date: Sat, 3 Apr 1999 11:41:46 +0000 Subject: 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 --- bin/sh/sh.1 | 3 +-- bin/sh/var.c | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'bin/sh') diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 5d5690a..423edb9 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 -.\" $Id: sh.1,v 1.25 1999/04/01 13:27:36 cracauer Exp $ +.\" $Id: sh.1,v 1.26 1999/04/02 09:28:00 cracauer Exp $ .\" .Dd May 5, 1995 .Dt SH 1 @@ -150,7 +150,6 @@ words on the command line to be treated as arguments. .Bl -tag -width Ds .It Fl a Li allexport Export all variables assigned to. -.Pq UNIMPLEMENTED .It Fl b Li notify Enable asynchronous notification of background job completion. 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 @@ -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)) { -- cgit v1.1