Skip to content

Commit

Permalink
minimal/do: some shells return error in "read x <file" for empty files.
Browse files Browse the repository at this point in the history
...or files that contain bytes but not a trailing newline.  It's okay if we
don't get any data, but we definitely have to *not* let "set -e" abort us.
Now that we fixed set -e in the previous patch, it revealed this problem.
  • Loading branch information
apenwarr committed Feb 9, 2012
1 parent c28181e commit 33dadbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion minimal/do
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ _run_dofile()
export REDO_TARGET=$PWD/$target
local line1
set -e
read line1 <"$PWD/$dofile"
read line1 <"$PWD/$dofile" || true
cmd=${line1#"#!/"}
if [ "$cmd" != "$line1" ]; then
/$cmd "$PWD/$dofile" "$@" >"$tmp.tmp2"
Expand Down

0 comments on commit 33dadbf

Please sign in to comment.