提交 1a7fa5e5 编写于 作者: R Rich Felker

fix regression in support for resolv.conf attempts option

commit d6cb08bc moved the code and
introduced an incorrect string offset for the new parsing, probably
due to a copy-and-paste error.

patch by Stefan Sedich.
上级 8c44a060
...@@ -45,8 +45,8 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) ...@@ -45,8 +45,8 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz)
if (z != p) conf->ndots = x > 15 ? 15 : x; if (z != p) conf->ndots = x > 15 ? 15 : x;
} }
p = strstr(line, "attempts:"); p = strstr(line, "attempts:");
if (p && isdigit(p[6])) { if (p && isdigit(p[9])) {
p += 6; p += 9;
unsigned long x = strtoul(p, &z, 10); unsigned long x = strtoul(p, &z, 10);
if (z != p) conf->attempts = x > 10 ? 10 : x; if (z != p) conf->attempts = x > 10 ? 10 : x;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册