Skip to content

Commit

Permalink
fix: if $bin DNE, do not execute
Browse files Browse the repository at this point in the history
E.g. gcc produces no output because `c --version` was run
  • Loading branch information
ryanmjacobs committed Sep 17, 2023
1 parent 779c123 commit 29b78bf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions c
Expand Up @@ -155,9 +155,14 @@ binname="$tmproot/$id.bin"
run() {
trap cleanup SIGINT

shift
(exec -a "$fname" "$binname" "$@")
ret=$?
if [ -x "$binname" ]; then
shift
(exec -a "$fname" "$binname" "$@")
ret=$?
else
echo
ret=4
fi

trap - SIGINT
cleanup
Expand Down

0 comments on commit 29b78bf

Please sign in to comment.