Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

- After the "TERMINAL TOO SMALL" screen, the map wasn't redrawn if the terminal went back to the same size it had before the shrink (`check_resize()` only redrew on a size change), so the warning stayed on screen. It now always redraws after that screen.
- Fixed a segfault on Ctrl-R (repeat last message) when there was no previous message: the 1982 `pline(0)` path fell through to `index(NULL,'%')`. Both the normal and SMALL builds now print "No message.". (#11)
- A comma in the player name (set via `name=` in options) split the high-score record line and wiped the record file. Commas in names are now replaced with `_`, and the record reader bounds its fields to their buffers. (#11)
- Fixed a crash at death from a wraith's level drain: the 1982 code never set `killer` there, so `done()` hit `strcpy(..., NULL)`. `done()` now also defaults `killer` for any other death path that misses it. (#12)
Expand Down
6 changes: 5 additions & 1 deletion src/root/hack.main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static void check_resize(void)
{
struct winsize ws;
int cols=0, rows=0;
int was_small=0; /* Modern: the TOO SMALL screen overwrote the map */

if(!resize_pending) return;
resize_pending=0;
Expand All @@ -41,6 +42,7 @@ static void check_resize(void)
rows=24;
}
if(cols<80 || rows<24) {
was_small=1;
for(;;) {
fd_set rfds;
struct timeval tv;
Expand All @@ -67,7 +69,9 @@ static void check_resize(void)
if(cols>=80 && rows>=24) break;
}
}
if(cols!=last_cols || rows!=last_rows) {
/* Modern: also redraw after the TOO SMALL screen even if the size is back
to what it was before the shrink, or that screen stays up */
if(was_small || cols!=last_cols || rows!=last_rows) {
docrt();
pline("[Terminal resized to %dx%d - display refreshed]",cols,rows);
last_cols=cols;
Expand Down
Loading