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 /bin | |
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 'bin')
-rwxr-xr-x | bin/eselect.in | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/eselect.in b/bin/eselect.in index 8fd1589..ea632ce 100755 --- a/bin/eselect.in +++ b/bin/eselect.in @@ -56,9 +56,10 @@ shopt -s extglob shopt -s expand_aliases # Save stderr file descriptor -# exec {ESELECT_STDERR}>&2 # >=bash-4.1 -exec 3>&2 -ESELECT_STDERR=3 +if (( BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 1 || BASH_VERSINFO[0] > 4 )) +then + exec {ESELECT_STDERR}>&2 # >=bash-4.1 +fi # Load core functions source "${ESELECT_CORE_PATH}/core.bash" || exit 255 |