ed: explicitly pass cooked error to $DONE
gs: only let $DONE be called once