diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-09-11 15:16:49 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-09-11 15:16:49 +0800 |
commit | 3e667e8bf274223b49012acc74707b3651668fe3 (patch) | |
tree | 3a89166476349056e32a285c3054b9704f95d5f9 /mbbsd/term.c | |
parent | f190a09af728c61ad2118cf908c6d831e8a594cf (diff) | |
download | pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.gz pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.bz2 pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.lz pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.xz pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.zst pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.zip |
not only long screen, but also width screen
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@518 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/term.c')
-rw-r--r-- | mbbsd/term.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mbbsd/term.c b/mbbsd/term.c index f5b2544b..ed112346 100644 --- a/mbbsd/term.c +++ b/mbbsd/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.9 2002/08/25 11:40:16 kcwu Exp $ */ +/* $Id: term.c,v 1.10 2002/09/11 07:16:49 kcwu Exp $ */ #include "bbs.h" int tgetent(const char *bp, char *name); @@ -60,6 +60,11 @@ term_resize(int sig) signal(SIGWINCH, SIG_IGN); /* Don't bother me! */ ioctl(0, TIOCGWINSZ, &newsize); + + /* make sure reasonable size */ + newsize.ws_row = MAX(24, MIN(100, newsize.ws_row)); + newsize.ws_col = MAX(80, MIN(200, newsize.ws_col)); + if (newsize.ws_row > t_lines) { new_picture = (screenline_t *) calloc(newsize.ws_row, sizeof(screenline_t)); @@ -72,6 +77,7 @@ term_resize(int sig) big_picture = new_picture; } t_lines = newsize.ws_row; + t_columns = newsize.ws_col; scr_lns = t_lines; /* XXX: scr_lns 跟 t_lines 有什麼不同, 為何分成兩個 */ b_lines = t_lines - 1; p_lines = t_lines - 4; |