This was previously all a single loop in res_init(), apart from option
parsing which we cleaned up in a previous commit. Break it out into
separate functions for reading the configuration line by line, setting
the default domain, setting the search list, and adding a nameserver
to the nameserver list. Sprinkle bounds checks and code comments all
around.
The sortlist code, which has been disabled for the past 20 years, will
be dealt with in a separate commit.
MFC after: 1 week