Fixed the gets() changes. The buffer contents is indeterminate when
fgets() returns NULL... Now when you type EOT at one of the prompts,
the program usually spins reading the sticky EOF instead of dumping
core. Even GUIs could do better.
Added $Id$.
Obtained from: partly from 4.4BSD-Lite2