]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
libsofia: handle mid-line comments in resolv.conf patch from Lee Verberne (SFSIP...
authorMichael Jerris <mike@jerris.com>
Wed, 10 Jun 2009 15:24:34 +0000 (15:24 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 10 Jun 2009 15:24:34 +0000 (15:24 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13749 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c

index 0e6219555a5163b7bc74301eee6bac9e28df5891..bbf309d5c12ed4aa1a359fbf7e090834eb5ba058 100644 (file)
@@ -1 +1 @@
-Thu Jun  4 16:10:50 CDT 2009
+Wed Jun 10 11:14:52 EDT 2009
index c6f1f19f7697952a20e6304478de6a35acafc3dd..769caa407c22c9879c2dffa91eacae84f65a5211 100644 (file)
@@ -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';