Update of bug #68875 (group groff):

                 Summary: [soelim] off-by-one error in warning diagnostic
about escaped space => [PATCH] [soelim] off-by-one error in warning diagnostic
about escaped space

    _______________________________________________________

Follow-up Comment #1:

Here's a fix.


diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 3b16481a4..bd0915c08 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -169,8 +169,13 @@ static void do_so(const char *line)
        filename += '\\';
        break;
       case ' ':
+       // Temporarily decrement the line counter because our caller
+       // incremented it; we're complaining about the `so` line itself.
+       // Postponing the caller's increment creates worse problems.
+       current_lineno--;
        warning("escaping a space is unnecessary and not compatible"
                " with troff syntax");
+       current_lineno++;
        filename += ' ';
        // TODO: groff 1.24.0 release + 2 years?
        // is_filename_valid = false; // or fall through




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68875>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to