diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-02-25 14:40:17 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-02-25 14:40:17 +0000 |
commit | 49e71ead2849c01f1a97690e318324e9243dcd3b (patch) | |
tree | 6644339a7a57b1d7f00091bbd39f9f27b0f7adc1 /usr.bin/mg/window.c | |
parent | 8ee2a01b688cb3911668295c00b731329070a8a1 (diff) |
Fix a coredump occurring when the terminal is resized while mg is
suspended. Problem reported and fixed tested by reyk@; tweak by
kjell@; ok kjell@
Diffstat (limited to 'usr.bin/mg/window.c')
-rw-r--r-- | usr.bin/mg/window.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/usr.bin/mg/window.c b/usr.bin/mg/window.c index f50ffbc975a..21e20296afa 100644 --- a/usr.bin/mg/window.c +++ b/usr.bin/mg/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.20 2005/12/13 06:01:27 kjell Exp $ */ +/* $OpenBSD: window.c,v 1.21 2006/02/25 14:40:16 otto Exp $ */ /* This file is in the public domain. */ @@ -59,21 +59,30 @@ reposition(int f, int n) * changed size, arrange that everything is redone, then call "update" to * fix the display. We do this so the new size can be displayed. In the * normal case the call to "update" in "main.c" refreshes the screen, and - * all of the windows need not be recomputed. Note that when you get to the - * "display unusable" message, the screen will be messed up. If you make the - * window bigger again, and send another command, everything will get fixed! + * all of the windows need not be recomputed. This call includes a + * 'force' parameter to ensure that the redraw is done, even after a + * a suspend/continue (where the window size parameters will already + * be updated). Note that when you get to the "display unusable" + * message, the screen will be messed up. If you make the window bigger + * again, and send another command, everything will get fixed! */ -/* ARGSUSED */ int redraw(int f, int n) { + return (do_redraw(f, n, FALSE)); +} + +/* ARGSUSED */ +int +do_redraw(int f, int n, int force) +{ struct mgwin *wp; int oldnrow, oldncol; oldnrow = nrow; oldncol = ncol; ttresize(); - if (nrow != oldnrow || ncol != oldncol) { + if (nrow != oldnrow || ncol != oldncol || force) { /* find last */ wp = wheadp; |