Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh Implement sh -a (allexport). Code (all two lines of ...



details:   https://anonhg.NetBSD.org/src/rev/e605e2f74018
branches:  trunk
changeset: 527015:e605e2f74018
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Wed May 15 19:43:29 2002 +0000

description:
Implement sh -a (allexport).  Code (all two lines of it) from FreeBSD
(FreeBSD var.c 1.13, sh.1 1.27).

diffstat:

 bin/sh/sh.1  |  4 ++--
 bin/sh/var.c |  6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r d66e7d4aebff -r e605e2f74018 bin/sh/sh.1
--- a/bin/sh/sh.1       Wed May 15 19:23:51 2002 +0000
+++ b/bin/sh/sh.1       Wed May 15 19:43:29 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sh.1,v 1.48 2002/05/15 16:33:35 christos Exp $
+.\"    $NetBSD: sh.1,v 1.49 2002/05/15 19:43:29 bjh21 Exp $
 .\" Copyright (c) 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
@@ -170,7 +170,7 @@
 builtin (described later).
 .Bl -tag -width aaaallexportfoo -offset indent
 .It Fl a Em allexport
-Export all variables assigned to. (UNIMPLEMENTED for 4.4alpha)
+Export all variables assigned to.
 .It Fl c
 Read commands from the command line.
 No commands will be read from the standard input.
diff -r d66e7d4aebff -r e605e2f74018 bin/sh/var.c
--- a/bin/sh/var.c      Wed May 15 19:23:51 2002 +0000
+++ b/bin/sh/var.c      Wed May 15 19:43:29 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.27 2001/02/04 19:52:07 christos Exp $        */
+/*     $NetBSD: var.c,v 1.28 2002/05/15 19:43:29 bjh21 Exp $   */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: var.c,v 1.27 2001/02/04 19:52:07 christos Exp $");
+__RCSID("$NetBSD: var.c,v 1.28 2002/05/15 19:43:29 bjh21 Exp $");
 #endif
 #endif /* not lint */
 
@@ -282,6 +282,8 @@
 {
        struct var *vp, **vpp;
 
+       if (aflag)
+               flags |= VEXPORT;
        vpp = hashvar(s);
        for (vp = *vpp ; vp ; vp = vp->next) {
                if (varequal(s, vp->text)) {



Home | Main Index | Thread Index | Old Index