This was supposed to act like `type -q` or `command -q`, in that it returns 0 if at least 1 exists. But because it used the wrong variable it didn't. Fixes #8431.