groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/01: Include space in diagnostic message corner cases.


From: G. Branden Robinson
Subject: [groff] 01/01: Include space in diagnostic message corner cases.
Date: Tue, 6 Nov 2018 12:19:39 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 50a9092bfa82900b0c07556f5b203a1a9c05d59c
Author: G. Branden Robinson <address@hidden>
Date:   Tue Nov 6 12:11:23 2018 -0500

    Include space in diagnostic message corner cases.
    
        * src/libs/libgroff/error.cpp * (do_error_with_file_and_line):
        If:
          a program name is known;
        but
          no file is being processed or the line number is negative,
        then there was no space between the program name (with colon),
        and the succeeding diagnostic message.
    
        Example: lookbib:fatal error: no databases
    
        Fixes <https://savannah.gnu.org/bugs/index.php?54971>.
    
    Signed-off-by: G. Branden Robinson <address@hidden>
---
 src/libs/libgroff/error.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/libs/libgroff/error.cpp b/src/libs/libgroff/error.cpp
index b959188..9a18803 100644
--- a/src/libs/libgroff/error.cpp
+++ b/src/libs/libgroff/error.cpp
@@ -50,6 +50,10 @@ static void do_error_with_file_and_line(const char *filename,
       fprintf(stderr, "%s:%d:", filename, lineno);
     need_space = 1;
   }
+  if (need_space) {
+    fputc(' ', stderr);
+    need_space = 0;
+  }
   switch (type) {
   case FATAL:
     fputs("fatal error:", stderr);



reply via email to

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