cat(1): refactor cook_args()/raw_args() into single function, cat_file()
- Combine the open/close portions of cook_args()/raw_args() into a single
function, cat_file().
- Push the flag-checking conditional in main() down into cat_file().
- Pull the argv loop in cat_file() up into main().
These changes -- especially pulling the argv look up into main() --
will allow us to drop the "rpath" promise in a single spot in a
subsequent patch.
Tweaked by mestre@. Descriptor leak in earlier version spotted by
Matthew Martin.
Thread: https://marc.info/?l=openbsd-tech&m=
163941848104274&w=2
No objections on tech@ after several weeks.