Do not export unset variables.

* gash/environment.scm (get-environ): Filter out unset variables.
* tests/42-sh-export-new.sh: New file.
* tests/42-sh-export-new.stdout: New file.
* Makefile.am (FULL_TESTS): Add tests/42-sh-export-new.sh.
(XFAIL_TESTS): Remove tests/42-export-new.sh and tests/42-sh-export.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
This commit is contained in:
Jan Nieuwenhuizen 2018-12-31 18:08:48 +01:00 committed by Timothy Sample
parent 25597a4bec
commit 13f43973f5
4 changed files with 7 additions and 4 deletions

View File

@ -204,6 +204,7 @@ FULL_TESTS = \
tests/42-sh.sh \
tests/42-sh-export.sh \
tests/42-export-new.sh \
tests/42-sh-export-new.sh \
tests/50-iohere.sh \
tests/50-iohere-builtin.sh \
tests/50-redirect.sh \
@ -234,8 +235,6 @@ TESTS = $(UNIT_TESTS) $(FULL_TESTS)
XFAIL_TESTS = \
tests/20-pipe-sed.sh \
tests/42-export-new.sh \
tests/42-sh-export.sh \
tests/70-hash.sh \
tests/70-hash-hash.sh \
tests/70-percent.sh \

View File

@ -1,5 +1,5 @@
;;; Gash -- Guile As SHell
;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
;;;
;;; This file is part of Gash.
;;;
@ -202,7 +202,7 @@ suitable for passing to @code{environ}. If @var{bindings} is set,
consider them as part of the set of current variables."
(let ((exported (hash-fold (lambda (name v acc)
(match v
(#(value #t _)
(#((? values value) #t _)
(cons `(,name . ,value) acc))
(_ acc)))
'()

View File

@ -0,0 +1,3 @@
export V
. tests/42-export-new.sh

View File

@ -0,0 +1 @@
no VEE