groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 07/26: [refer]: Fix off-by-one line numbering error.


From: G. Branden Robinson
Subject: [groff] 07/26: [refer]: Fix off-by-one line numbering error.
Date: Sun, 15 May 2022 05:07:53 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit b9248fcd744e3c70bad22488b2242c1b86f09f2f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed May 4 19:09:30 2022 -0500

    [refer]: Fix off-by-one line numbering error.
    
    * src/preproc/refer/refer.cpp (do_file): Fix another off-by-one line
      number reporting bug exposed by fix for Savannah #62391.
---
 ChangeLog                   | 5 +++++
 src/preproc/refer/refer.cpp | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 266ae722..1cff09f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-05-04  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/preproc/refer/refer.cpp (do_file): Fix another off-by-one
+       line number reporting bug exposed by fix for Savannah #62391.
+
 2022-05-04  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/refer/tests/report-correct-line-numbers.sh: Add
diff --git a/src/preproc/refer/refer.cpp b/src/preproc/refer/refer.cpp
index ee784583..76d59493 100644
--- a/src/preproc/refer/refer.cpp
+++ b/src/preproc/refer/refer.cpp
@@ -590,7 +590,9 @@ static void do_file(const char *filename)
          break;
        }
        if (invalid_input_char(c))
-         error("invalid input character code %1", c);
+         error_with_file_and_line(current_filename, start_lineno,
+                                  "invalid input character code %1",
+                                  c);
        else {
          line += c;
          at_start_of_line = ('\n' == c);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]