diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-02-07 13:56:13 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-02-07 14:12:38 +0000 |
| commit | 631c63d5a4a46914a521d1a7adcf88caf6b99902 (patch) | |
| tree | 04407e9ffac67d05bb93f43e0192e4437448337e /foot-server@.socket | |
| parent | Merge branch 'selection-handling-during-reflow' (diff) | |
term: scrollback-to-text: crash when trying to extract the entire scrollback
We calculated the ‘start’ row by adding the number of screen rows to
the current grid offset. This works in most cases. But not when the
offset is close to the wrap-around.
This triggered a crash when we tried to access a row number larger
than the number of available grid rows.
Fix by bounding the start row to the number of grid rows.
This unearthed a second bug, where trying to extract the scrollback
resulted in nothing getting copied.
The extraction logic did:
for (r = start; r != (end + 1); r++)
....
This works, as long as end isn’t start-1. When we try to extract the
entire scrollback, it _is_ start-1.
Fix by rewriting the loop logic to check for r==end *after* copying
the row contents, but *before* incrementing r.
Closes #926
Diffstat (limited to 'foot-server@.socket')
0 files changed, 0 insertions, 0 deletions
