From ca5baef4336ffb80daeca9f8a15f2649463a0d35 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 21 Jul 2021 13:58:07 +0200 Subject: [PATCH] - Fix that ldns_zone_new_frm_fp_l counts the line number for an empty line after a comment. --- doc/Changelog | 4 ++++ sldns/parse.c | 3 +++ 2 files changed, 7 insertions(+) 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;