groff-commit
[Top][All Lists]
Advanced

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

[groff] 07/72: [eqn]: Fix incorrect update of line number.


From: G. Branden Robinson
Subject: [groff] 07/72: [eqn]: Fix incorrect update of line number.
Date: Sun, 23 Oct 2022 22:25:34 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit f49eea14745a72ded30ac9721a8401244cb6d7ed
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
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 <g.branden.robinson@gmail.com>
+
+       * src/preproc/eqn/main.cpp (read_line): Fix switched test
+       consequents when updating `current_lineno`.
+
 2022-10-18  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * 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;
 }
 



reply via email to

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