diff options
author | Ulrich Müller <ulm@gentoo.org> | 2013-07-06 15:05:46 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2013-07-06 15:05:46 +0200 |
commit | 3a412426d924310abb59311dd3cc1133eb1c6849 (patch) | |
tree | 63151e69c4945eae8ac9238fb522a2e92309d38b /libs | |
parent | Update copyright notice. (diff) | |
download | eselect-3a412426d924310abb59311dd3cc1133eb1c6849.tar.gz eselect-3a412426d924310abb59311dd3cc1133eb1c6849.tar.bz2 eselect-3a412426d924310abb59311dd3cc1133eb1c6849.zip |
Work around bash crashing on Darwin, bug 475284.
* bin/eselect.in: Save stderr only in bash 4.1 or later, where
automatically assigned file descriptors are available. Using a
fixed descriptor makes bash crash on Darwin, bug 475284.
* libs/core.bash.in (die): Test for saved file descriptor.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/core.bash.in | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/core.bash.in b/libs/core.bash.in index fe174d1..2a682ce 100644 --- a/libs/core.bash.in +++ b/libs/core.bash.in @@ -32,8 +32,8 @@ check_do() { die() { local item funcname="" sourcefile="" lineno="" n e s="yes" - # Restore stderr if it was redirected - exec 2>&${ESELECT_STDERR} + # Restore stderr + [[ -n ${ESELECT_STDERR} ]] && exec 2>&${ESELECT_STDERR} # do we have a working write_error_msg? if is_function "write_error_msg"; then |