]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that ldns_zone_new_frm_fp_l counts the line number for an empty
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 21 Jul 2021 11:58:07 +0000 (13:58 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 21 Jul 2021 11:58:07 +0000 (13:58 +0200)
  line after a comment.

doc/Changelog
sldns/parse.c

index d16391c5ad7578277ace2f8fa25ee702761610ea..3988d0c9d31b60dfcaf1d542bcf77a3840d22309 100644 (file)
@@ -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.
 
index f4de8602fd6939f6089abd48a7ef737d2fa7b06a..491c8f51bf101c6b529fa44caaee62fc09989036 100644 (file)
@@ -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;