]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
handle carriage returns
authorMatthijs Mekking <matje@NLnetLabs.nl>
Mon, 24 Oct 2011 13:06:07 +0000 (13:06 +0000)
committerMatthijs Mekking <matje@NLnetLabs.nl>
Mon, 24 Oct 2011 13:06:07 +0000 (13:06 +0000)
parse.c

diff --git a/parse.c b/parse.c
index eab22dfc8e9f88c2fe1a48cc064d7a473c56960d..3689b60ac1b7cbd6687419a9024ed85db30426dd 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -56,6 +56,8 @@ ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *li
                quoted = 1;
        }
        while ((c = getc(f)) != EOF) {
+               if (c == 13) /* carriage return */
+                       c = ' ';
                if (c == '(' && prev_c != '\\' && !quoted) {
                        /* this only counts for non-comments */
                        if (com == 0) {
@@ -241,6 +243,8 @@ ldns_bget_token(ldns_buffer *b, char *token, const char *delim, size_t limit)
        }
 
        while ((c = ldns_bgetc(b)) != EOF) {
+               if (c == 13) /* carriage return */
+                       c = ' ';
                if (c == '(' && lc != '\\' && !quoted) {
                        /* this only counts for non-comments */
                        if (com == 0) {