gbranden pushed a commit to branch master
in repository groff.

commit f49eea14745a72ded30ac9721a8401244cb6d7ed
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Oct 18 12:14:12 2022 -0500

    [eqn]: Fix incorrect update of line number.
    
    * src/preproc/eqn/main.cpp (read_line): Fix switched test consequents
      when updating `current_lineno`.
    
    Problem introduced by me in commit c2e894cf5b, 16 October.
---
 ChangeLog                | 5 +++++
 src/preproc/eqn/main.cpp | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8fd6990fd..3cc93fff7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-10-18  G. Branden Robinson <[email protected]>
+
+       * src/preproc/eqn/main.cpp (read_line): Fix switched test
+       consequents when updating `current_lineno`.
+
 2022-10-18  G. Branden Robinson <[email protected]>
 
        * src/utils/xtotroff/xtotroff.c (main): Annotate "xtotroff" as a
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index eee83d435..81918896f 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -90,9 +90,9 @@ static bool read_line(FILE *fp, string *p)
   }
   bool is_end_of_file = (p->length() > 0);
   if (is_end_of_file)
-    current_lineno++;
-  else
     current_lineno = 0;
+  else
+    current_lineno++;
   return is_end_of_file;
 }
 

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to