Przeglądaj źródła

fix logic for matching search/domain keywords in resolv.conf

Rich Felker 9 lat temu
rodzic
commit
fe8453d2ee
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/network/resolvconf.c

+ 1 - 1
src/network/resolvconf.c

@@ -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++);