From 28520e41acb802400508ee09d57bfefb4b32d18e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 11 Mar 2018 13:35:53 +0000 Subject: [PATCH] terminal.c: put source commit id in 'line==NULL' dialog. People sometimes send in cut-and-pastes of that dialog box from very old versions of PuTTY. This can usually be detected because the 'lineno' field in the error message refers to a line number in terminal.c which doesn't have a call to lineptr() or scrlineptr() on it _now_ but used to a long time ago). But that's a pretty roundabout way to detect anything, so let's put some more reliable version information in the error message. (This might also provide a way to test the hypothesis that whatever bug used to cause this dialog box to appear is now fixed, and that _all_ remaining reports of this error message are from outdated builds.) --- terminal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terminal.c b/terminal.c index 06f41e44..afc9b2c2 100644 --- a/terminal.c +++ b/terminal.c @@ -1085,19 +1085,21 @@ static termline *lineptr(Terminal *term, int y, int lineno, int screen) /* We assume that we don't screw up and retrieve something out of range. */ if (line == NULL) { + extern const char commitid[]; /* in version.c */ modalfatalbox("line==NULL in terminal.c\n" "lineno=%d y=%d w=%d h=%d\n" "count(scrollback=%p)=%d\n" "count(screen=%p)=%d\n" "count(alt=%p)=%d alt_sblines=%d\n" - "whichtree=%p treeindex=%d\n\n" + "whichtree=%p treeindex=%d\n" + "commitid=%s\n\n" "Please contact " "and pass on the above information.", lineno, y, term->cols, term->rows, term->scrollback, count234(term->scrollback), term->screen, count234(term->screen), term->alt_screen, count234(term->alt_screen), - term->alt_sblines, whichtree, treeindex); + term->alt_sblines, whichtree, treeindex, commitid); } assert(line != NULL);