From 32c00a01b55a94c13a0c7064154bb276c0a8372c Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 2 Nov 2008 21:12:43 +0100 Subject: [PATCH] Handle exit code translation failures gracefully. Apparantly, "X=`false`" fails with a non-zero exit code (and the script stops), even though "echo `false`" doesn't. --- eval/libeval.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval/libeval.sh b/eval/libeval.sh index 6d2ffb1..2bb84bb 100644 --- a/eval/libeval.sh +++ b/eval/libeval.sh @@ -263,14 +263,14 @@ function test-result SG=${M#Caught fatal signal } SG=${SG#Committed suicide by signal } if [ "$SG" != "$M" ] ; then - SG=`kill -l $SG 2>/dev/null` + SG=`kill -l $SG 2>/dev/null` || SG= [ -z "$SG" ] || M="$M (SIG$SG)" fi # Translate runtime errors to readable strings RE=${M#Exited with error status } if [ -n "$EXIT_CODE_HOOK" -a "$RE" != "$M" ] ; then - NEWMSG=`$EXIT_CODE_HOOK $RE` + NEWMSG=`$EXIT_CODE_HOOK $RE` || NEWMSG= if [ -n "$NEWMSG" ] ; then M="Runtime error $RE: $NEWMSG" fi -- 2.39.2