[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 06/27: [troff]: Fix backtrace output in degenerate case.
From: |
G. Branden Robinson |
Subject: |
[groff] 06/27: [troff]: Fix backtrace output in degenerate case. |
Date: |
Tue, 3 May 2022 14:27:14 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 2fc5508dd89fbd821f6899c94a778fe5c5c1f6bd
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun May 1 22:32:30 2022 -0500
[troff]: Fix backtrace output in degenerate case.
* src/roff/troff/input.cpp (string_iterator::backtrace): Fix spurious
output when `mac.filename` is empty. Provoked by:
$ printf '\\(' | troff
---
ChangeLog | 6 ++++++
src/roff/troff/input.cpp | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 20d6e879..64b3304c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-05-01 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/roff/troff/input.cpp (string_iterator::backtrace): Fix
+ spurious output when `mac.filename` is empty. Provoked by:
+ $ printf '\\(' | troff
+
2022-05-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/refer/refer.cpp: Trivially refactor. Demote
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 029bfad8..80959fd4 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -3579,9 +3579,9 @@ int string_iterator::get_location(int allow_macro,
void string_iterator::backtrace()
{
- if (program_name)
- fprintf(stderr, "%s: ", program_name);
if (mac.filename) {
+ if (program_name)
+ fprintf(stderr, "%s: ", program_name);
errprint("backtrace: '%1':%2", mac.filename,
mac.lineno + lineno - 1);
if (how_invoked) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 06/27: [troff]: Fix backtrace output in degenerate case.,
G. Branden Robinson <=