Skip to content

Commit d9f9ee5

Browse files
authored
Fix unbound variable in log initialization (#173)
1 parent 8054419 commit d9f9ee5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/log.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ==============================================================================
99

1010
# Unless $LOG_FD is already set to a valid fd
11-
if ! [[ "$LOG_FD" =~ ^[0-9]+$ ]] || ! { true >&"$LOG_FD" ; } 2>/dev/null ; then
11+
if ! [[ "${LOG_FD-}" =~ ^[0-9]+$ ]] || ! { : >&"${LOG_FD-2}"; } 2>/dev/null; then
1212
# Preserve the original STDOUT on a free fd (stored in $LOG_FD) so that we can
1313
# log to it without interfering with the STDOUT of subshells whose output we
1414
# want to capture for other purposes.

0 commit comments

Comments
 (0)