From: Martin Mares Date: Sun, 2 Nov 2008 20:12:43 +0000 (+0100) Subject: Handle exit code translation failures gracefully. X-Git-Tag: python-dummy-working~133 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=32c00a01b55a94c13a0c7064154bb276c0a8372c;p=eval.git 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. --- 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