Don't ignore the last line of config file (/etc/hosts, /etc/services, etc)
which doesn't end in \n, since it may be very confusing. Also this should increase consistency, since most other config files work just fine regardless of the presence of traling \n in the last line. MFC After: 2 weeks
This commit is contained in:
parent
4bf9384dba
commit
742d1c9a2d
@ -2070,9 +2070,9 @@ again:
|
||||
return (NULL);
|
||||
if (*p == '#')
|
||||
goto again;
|
||||
if (!(cp = strpbrk(p, "#\n")))
|
||||
goto again;
|
||||
*cp = '\0';
|
||||
cp = strpbrk(p, "#\n");
|
||||
if (cp != NULL)
|
||||
*cp = '\0';
|
||||
if (!(cp = strpbrk(p, " \t")))
|
||||
goto again;
|
||||
*cp++ = '\0';
|
||||
|
@ -118,9 +118,9 @@ gethostent()
|
||||
}
|
||||
if (*p == '#')
|
||||
goto again;
|
||||
if (!(cp = strpbrk(p, "#\n")))
|
||||
goto again;
|
||||
*cp = '\0';
|
||||
cp = strpbrk(p, "#\n");
|
||||
if (cp != NULL)
|
||||
*cp = '\0';
|
||||
if (!(cp = strpbrk(p, " \t")))
|
||||
goto again;
|
||||
*cp++ = '\0';
|
||||
|
@ -105,9 +105,8 @@ again:
|
||||
if (*p == '#')
|
||||
goto again;
|
||||
cp = strpbrk(p, "#\n");
|
||||
if (cp == NULL)
|
||||
goto again;
|
||||
*cp = '\0';
|
||||
if (cp != NULL)
|
||||
*cp = '\0';
|
||||
net.n_name = p;
|
||||
cp = strpbrk(p, " \t");
|
||||
if (cp == NULL)
|
||||
|
@ -87,9 +87,8 @@ again:
|
||||
if (*p == '#')
|
||||
goto again;
|
||||
cp = strpbrk(p, "#\n");
|
||||
if (cp == NULL)
|
||||
goto again;
|
||||
*cp = '\0';
|
||||
if (cp != NULL)
|
||||
*cp = '\0';
|
||||
proto.p_name = p;
|
||||
cp = strpbrk(p, " \t");
|
||||
if (cp == NULL)
|
||||
|
@ -244,9 +244,8 @@ unpack:
|
||||
if (*p == '#')
|
||||
goto again;
|
||||
cp = strpbrk(p, "#\n");
|
||||
if (cp == NULL)
|
||||
goto again;
|
||||
*cp = '\0';
|
||||
if (cp != NULL)
|
||||
*cp = '\0';
|
||||
serv.s_name = p;
|
||||
p = strpbrk(p, " \t");
|
||||
if (p == NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user