]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
* Fix that ldns-read-zone and ldns_zone_new_frm_fp_l count the line
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 21 Jul 2021 11:56:40 +0000 (13:56 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 21 Jul 2021 11:56:40 +0000 (13:56 +0200)
  number for an empty line after a comment.

Changelog
parse.c

index 2eac649ecf019e96e99d7507233923ae094615ff..6966b0ec5aea771fba6ea9b69cdb56874c56aef8 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -28,6 +28,8 @@
        * PR #134 Miscellaneous spelling fixes. Thanks jsoref!
        * Fix that ldns-read-zone and ldns_zone_new_frm_fp_l properly return
          the $INCLUDE not implemented error.
+       * Fix that ldns-read-zone and ldns_zone_new_frm_fp_l count the line
+         number for an empty line after a comment.
 
 1.7.1  2019-07-26
        * bugfix: Manage verification paths for OpenSSL >= 1.1.0
diff --git a/parse.c b/parse.c
index 3c737620293ec0e24f5e890e8ff4c167d90ee758..9698ba71e881e8d9beeffb5c8618c4249feeb2df 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -187,6 +187,9 @@ ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed
                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;