summaryrefslogtreecommitdiffstats
path: root/games/tetrinet/patches/check_term_size.diff
diff options
context:
space:
mode:
Diffstat (limited to 'games/tetrinet/patches/check_term_size.diff')
-rw-r--r--games/tetrinet/patches/check_term_size.diff19
1 files changed, 19 insertions, 0 deletions
diff --git a/games/tetrinet/patches/check_term_size.diff b/games/tetrinet/patches/check_term_size.diff
new file mode 100644
index 0000000000..31c1896ec4
--- /dev/null
+++ b/games/tetrinet/patches/check_term_size.diff
@@ -0,0 +1,19 @@
+diff -Naur tetrinet-0.11/tty.c tetrinet-0.11.patched/tty.c
+--- tetrinet-0.11/tty.c 2003-09-11 16:26:53.000000000 -0400
++++ tetrinet-0.11.patched/tty.c 2020-11-21 00:53:04.798758121 -0500
+@@ -237,6 +237,15 @@
+ if ((has_color = has_colors()))
+ start_color();
+ getmaxyx(stdscr, scrheight, scrwidth);
++
++ if(scrheight < 50 || scrwidth < 80) {
++ screen_cleanup();
++ fprintf(stderr,
++ "Terminal size %dx%d is too small. Minimum is 80x50.\n",
++ scrwidth, scrheight);
++ exit(-1);
++ }
++
+ scrwidth--; /* Don't draw in last column--this can cause scroll */
+
+ /* Cancel all this when we exit. */