_prepare_env: check definedness instead of value

Check whether inputbuf is defined instead of evaluating it for truth.

The old behavior caused a body consisting only of "0" to disappear; this
commit fixes the problem.