mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
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.
This commit is contained in:
parent
38fe0f7292
commit
5525339901
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user