提交 acd67cb3 authored 作者: Michael Jerris's avatar Michael Jerris

libsofia: handle mid-line comments in resolv.conf patch from Lee Verberne (SFSIP-152)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13749 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 3398ddfc
Thu Jun 4 16:10:50 CDT 2009 Wed Jun 10 11:14:52 EDT 2009
...@@ -2270,11 +2270,11 @@ int sres_parse_config(sres_config_t *c, FILE *f) ...@@ -2270,11 +2270,11 @@ int sres_parse_config(sres_config_t *c, FILE *f)
/* Skip whitespace at the beginning ...*/ /* Skip whitespace at the beginning ...*/
b = buf + strspn(buf, " \t"); b = buf + strspn(buf, " \t");
/* ... and at the end of line */ /* ... and comments + whitespace at the end */
for (len = strlen(b); len > 0 && strchr(" \t\r\n", b[len - 1]); len--) for (len = strcspn(b, "#;"); len > 0 && strchr(" \t\r\n", b[len - 1]); len--)
; ;
if (len == 0 || b[0] == '#') /* Empty line or comment */ if (len == 0) /* Empty line or comment */
continue; continue;
b[len] = '\0'; b[len] = '\0';
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论