fix logic for matching search/domain keywords in resolv.conf
authorRich Felker <dalias@aerifal.cx>
Fri, 29 Jan 2016 00:20:13 +0000 (19:20 -0500)
committerRich Felker <dalias@aerifal.cx>
Fri, 29 Jan 2016 00:20:13 +0000 (19:20 -0500)
src/network/resolvconf.c

index 0743a88faae1bfc0d632f2358f04ec62ceb55f8a..7e4dbe21a13e9519efe74f14736b50ae0baeb0cc 100644 (file)
@@ -69,7 +69,7 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz)
                }
 
                if (!search) continue;
-               if (strncmp(line, "domain", 6) || strncmp(line, "search", 6)
+               if ((strncmp(line, "domain", 6) && strncmp(line, "search", 6))
                    || !isspace(line[6]))
                        continue;
                for (p=line+7; isspace(*p); p++);