From: W.C.A. Wijngaards Date: Wed, 21 Jul 2021 11:58:07 +0000 (+0200) Subject: - Fix that ldns_zone_new_frm_fp_l counts the line number for an empty X-Git-Tag: release-1.13.2rc1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca5baef4336ffb80daeca9f8a15f2649463a0d35;p=thirdparty%2Funbound.git - Fix that ldns_zone_new_frm_fp_l counts the line number for an empty line after a comment. --- diff --git a/doc/Changelog b/doc/Changelog index d16391c5a..3988d0c9d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +21 July 2021: Wouter + - Fix that ldns_zone_new_frm_fp_l counts the line number for an empty + line after a comment. + 16 July 2021: George - Introduce 'http-user-agent:' and 'hide-http-user-agent:' options. diff --git a/sldns/parse.c b/sldns/parse.c index f4de8602f..491c8f51b 100644 --- a/sldns/parse.c +++ b/sldns/parse.c @@ -149,6 +149,9 @@ sldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *l if (c != '\0' && c != '\n') { *t++ = c; } + if (c == '\n' && line_nr) { + *line_nr = *line_nr + 1; + } if (c == '\\' && prev_c == '\\') prev_c = 0; else prev_c = c;