Project

General

Profile

« Previous | Next » 

Revision 13223

bugfix: lib/sh/util.sh: stderr_matches(): also need to handle any filter error, such as caused by Ctrl+C

View differences:

util.sh
1094 1094
	echo_vars PIPESTATUS_
1095 1095
	set -o errexit
1096 1096
	
1097
	# handle any error
1098
	e="${PIPESTATUS_[0]}" # 1st command's exit status -> $e
1097
	# handle any command error
1098
	e="${PIPESTATUS_[0]}"
1099 1099
	local matches="$(errexit "${PIPESTATUS_[1]}"; exit2bool)"
1100 1100
	if test "$matches"; then ignore_e "$ignore_e"; fi #also works w/ ignore_e=''
1101 1101
	rethrow_exit #force-exit b/c caller's test of return status disables errexit
1102 1102
	
1103
	# handle any filter error
1104
	e="${PIPESTATUS_[1]}"
1105
	ignore_e 1 # false is not an error
1106
	# all other unsuccessful exit statuses are errors
1107
	rethrow_exit #force-exit b/c caller's test of return status disables errexit
1108
	
1103 1109
	return "${PIPESTATUS_[1]}" # 2nd command's exit status -> $?
1104 1110
}
1105 1111

  

Also available in: Unified diff