]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
handle comments
authorMiek Gieben <miekg@NLnetLabs.nl>
Mon, 28 Feb 2005 14:10:14 +0000 (14:10 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Mon, 28 Feb 2005 14:10:14 +0000 (14:10 +0000)
rr.c

diff --git a/rr.c b/rr.c
index ff14ed3eeffade4d8adb3c25bfbb61ec259e6d94..7d8776b3dd23d06cca2b3c58624926877032b442 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -71,21 +71,24 @@ ldns_rr_str_normalize(const char *rr)
        char *p;
        char *s;
        char *orig_s;
-       int sp_removed;
 
        s = XMALLOC(char, strlen(rr)); /* for the newly created string */
        orig_s = s;
-       sp_removed = 0;
 
        /* walk through the rr and fix it. Whitespace is handled in
         * ldns_rr_new_frm_str(), so don't worry about that here
         * - remove (, ) and \n
+        * - everything after ; is discard
+        * - allow for simple escaping, with \??? TODO Miek
         */
        for(p = (char*)rr; *p; p++) {
                if (*p == '(' || *p == ')' || *p == '\n') {
                        continue;
                }
-               sp_removed = 0;
+               if (*p == ';') {
+                       /* comment seen, bail out */
+                       break;
+               }
                *s++ = *p;
        }
        *s = '\0';