From: Matthijs Mekking Date: Mon, 24 Oct 2011 13:06:07 +0000 (+0000) Subject: handle carriage returns X-Git-Tag: release-1.6.12~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f952df202bdd0b99cb0b3f1f380fb526e90bdd21;p=thirdparty%2Fldns.git handle carriage returns --- diff --git a/parse.c b/parse.c index eab22dfc..3689b60a 100644 --- 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) {