NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/48926: gethostbyname(3) doesn't appear to work under NetBSD-5.2 and NetBSD-6.1.x when hostnames appear only in /etc/hosts



On Mon, Jun 23, 2014 at 05:00:00PM +0000, Brian Buhrow wrote:
>  2.  The second patch eats the last character of the current line and avoids
>  having to save and restore any values.  By the time we get to the place
>  where my patch takes effect in the code, we know we're dealing with a line
>  that's not just a comment line, and the code assumes the line either ends
>  with a "#" or a newline character, and if it doesn't end with either of
>  those two things, the line is ignored.

The test for blankish would fix that as well. You don't need to loop,
just check if the last character can be replaced and otherwise keep it.
That just makes it work for files without trailing newline.

Joerg


Home | Main Index | Thread Index | Old Index