subshell term payload improved
This commit is contained in:
+4
-1
@@ -90,6 +90,10 @@ function on_exit {
|
|||||||
if [[ -p /dev/stdout ]]; then
|
if [[ -p /dev/stdout ]]; then
|
||||||
failure_type='SUBSHELL TERM'
|
failure_type='SUBSHELL TERM'
|
||||||
failure_payload="$last_error"
|
failure_payload="$last_error"
|
||||||
|
|
||||||
|
if [[ "$last_error" =~ $regex1 || "$last_error" =~ $regex2 ]]; then
|
||||||
|
failure_payload="${BASH_REMATCH[2]}"
|
||||||
|
fi
|
||||||
last_error="${BASH_SOURCE[1]}:${BASH_LINENO[0]} subshell term $code"
|
last_error="${BASH_SOURCE[1]}:${BASH_LINENO[0]} subshell term $code"
|
||||||
kill -USR1 $$
|
kill -USR1 $$
|
||||||
else
|
else
|
||||||
@@ -100,7 +104,6 @@ function on_exit {
|
|||||||
if [[ "$last_error" =~ $regex1 || "$last_error" =~ $regex2 ]]; then
|
if [[ "$last_error" =~ $regex1 || "$last_error" =~ $regex2 ]]; then
|
||||||
line=${BASH_REMATCH[1]}
|
line=${BASH_REMATCH[1]}
|
||||||
message=${BASH_REMATCH[2]}
|
message=${BASH_REMATCH[2]}
|
||||||
|
|
||||||
regex='^(.*): unbound variable$'
|
regex='^(.*): unbound variable$'
|
||||||
if [[ $code == 1 ]] && [[ "$message" =~ $regex ]]; then
|
if [[ $code == 1 ]] && [[ "$message" =~ $regex ]]; then
|
||||||
failure_type='UNBOUND VARIABLE'
|
failure_type='UNBOUND VARIABLE'
|
||||||
|
|||||||
Reference in New Issue
Block a user