[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: Tweak minor details of #58153 fix.
From: |
G. Branden Robinson |
Subject: |
[groff] 01/01: Tweak minor details of #58153 fix. |
Date: |
Sat, 11 Apr 2020 05:20:06 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 1ff4903b9c04a2504da938036e07e2b7d95a8147
Author: G. Branden Robinson <address@hidden>
AuthorDate: Sat Apr 11 19:12:49 2020 +1000
Tweak minor details of #58153 fix.
* ChangeLog: Explain root-clause analysis more completely.
* src/roff/troff/input.cpp: Use same brief-scope variable names as
earlier code for better continuity.
---
ChangeLog | 7 ++++++-
src/roff/troff/input.cpp | 8 ++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 07d5fbe..e495489 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,7 +60,12 @@
get_location() for its side effect of rewriting a filename of
"-" to "<standard input>", for consistency with other diagnostic
messages. (In this class, this member function always returns
- 1, so ignore the return value.)
+ 1, so ignore the return value. This fact is an essential part
+ of what led to the bug; the conditional
+ p && !p->get_location(0, &f, &n)
+ which appeared in the for loop of the old
+ input_stack::backtrace() would always evaluate to false when a
+ node of the file_iterator class was encountered.)
(input_stack::backtrace): Replace member function body with that
of input_stack::backtrace_all().
(input_stack::backtrace_all): Delete.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index f35fcbf..26394ad 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -401,13 +401,13 @@ int file_iterator::get_location(int /*allow_macro*/,
void file_iterator::backtrace()
{
- const char *fn;
- int l;
+ const char *f;
+ int n;
// Get side effect of filename rewrite if stdin.
- (void) get_location(0, &fn, &l);
+ (void) get_location(0, &f, &n);
if (program_name)
fprintf(stderr, "%s: ", program_name);
- errprint("backtrace: %3 '%1':%2\n", fn, l, popened ? "pipe" : "file");
+ errprint("backtrace: %3 '%1':%2\n", f, n, popened ? "pipe" : "file");
}
int file_iterator::set_location(const char *f, int ln)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: Tweak minor details of #58153 fix.,
G. Branden Robinson <=