summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--src/roff/troff/input.cpp8
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 07d5fbe8b..e4954897d 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 f35fcbf3c..26394ade0 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)