From 55253399013924e6d8a2ddc8589341b80496e093 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Sun, 8 Jan 2006 07:43:44 +0000 Subject: [PATCH] Fix add_document_to_string to add all chars in a line, not just the first Revision 1.82 of src/scripting/lua/core.c and revision 1.42 of src/viewer/dump/dump.c (2 years, 2 months ago), which moved add_document_to_string from the former to the latter, introduced a logic error: the local variable pos was set in the outer loop, which iterates thru the lines in the document, whereas it should be (and had been) set in the inner loop, which iterates thru the columns. This brings us all the way back to a working current_document_formatted for Lua scripts. --- src/viewer/dump/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewer/dump/dump.c b/src/viewer/dump/dump.c index e88115fbf..9b38ab2de 100644 --- a/src/viewer/dump/dump.c +++ b/src/viewer/dump/dump.c @@ -324,11 +324,11 @@ add_document_to_string(struct string *string, struct document *document) if_assert_failed return NULL; for (y = 0; y < document->height; y++) { - struct screen_char *pos = document->data[y].chars; int white = 0; int x; for (x = 0; x < document->data[y].length; x++) { + struct screen_char *pos = &document->data[y].chars[x]; unsigned char data = pos->data; unsigned int frame = (pos->attr & SCREEN_ATTR_FRAME);