[SIGAR-83] skip comment lines in resolv.conf

This commit is contained in:
Doug MacEachern 2008-01-22 01:26:39 +00:00
parent 4c522ad7ed
commit 2959b4a4ea
1 changed files with 3 additions and 1 deletions

View File

@ -1242,7 +1242,9 @@ int sigar_net_info_get(sigar_t *sigar,
int len; int len;
SIGAR_SKIP_SPACE(ptr); SIGAR_SKIP_SPACE(ptr);
if (!(ptr = strstr(ptr, "nameserver"))) { if ((*ptr == '#') ||
!(ptr = strstr(ptr, "nameserver")))
{
continue; continue;
} }
ptr += 10; ptr += 10;