Project

General

Profile

« Previous | Next » 

Revision 9028

bugfix: lib/sh/util.sh: bool2int (): need to use try instead of save_e_cmd because save_e_cmd rethrows the error, which should instead just be stored in $e. this bug was not found in testing because bool2int was only used in $(), which errexit does not apply to.

View differences:

lib/sh/util.sh
101 101
let () { builtin let "$@" || true; }
102 102
	# "If the last ARG evaluates to 0, let returns 1" (`help let`)
103 103

  
104
bool2int () { save_e_cmd test -z "$1"; echo "$e"; } # empty->0; non-empty->1
104
bool2int () { try test -z "$1"; echo "$e"; } # empty->0; non-empty->1
105 105

  
106 106

  
107 107
#### arrays

Also available in: Unified diff