From: Michael Jerris Date: Wed, 10 Jun 2009 15:24:34 +0000 (+0000) Subject: libsofia: handle mid-line comments in resolv.conf patch from Lee Verberne (SFSIP... X-Git-Tag: v1.0.4~507 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acd67cb318e9d2a0f1d76521ddba5cf0b0d7dddd;p=thirdparty%2Ffreeswitch.git 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 --- diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 0e6219555a..bbf309d5c1 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Thu Jun 4 16:10:50 CDT 2009 +Wed Jun 10 11:14:52 EDT 2009 diff --git a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c index c6f1f19f76..769caa407c 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c +++ b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c @@ -2270,11 +2270,11 @@ int sres_parse_config(sres_config_t *c, FILE *f) /* Skip whitespace at the beginning ...*/ b = buf + strspn(buf, " \t"); - /* ... and at the end of line */ - for (len = strlen(b); len > 0 && strchr(" \t\r\n", b[len - 1]); len--) + /* ... and comments + whitespace at the end */ + 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; b[len] = '\0';