diff options
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r-- | mbbsd/io.c | 33 |
1 files changed, 9 insertions, 24 deletions
@@ -427,22 +427,17 @@ igetch(void) screen_backup_t old_screen; int oldroll = roll; - int y, x, my_newfd; + int my_newfd; - getyx(&y, &x); - old_screen.raw_memory = malloc(screen_backupsize(t_lines, big_picture)); - screen_backup(t_lines, big_picture, &old_screen); + screen_backup(&old_screen); my_newfd = i_newfd; i_newfd = 0; t_users(); i_newfd = my_newfd; - screen_restore(t_lines, big_picture, &old_screen); - free(old_screen.raw_memory); roll = oldroll; - move(y, x); - redoscr(); + screen_restore(&old_screen); continue; } return ch; @@ -462,21 +457,16 @@ igetch(void) if (currutmp->msgs[0].pid && WATERMODE(WATER_OFO) && wmofo == NOTREPLYING) { - int y, x, my_newfd; + int my_newfd; screen_backup_t old_screen; - old_screen.raw_memory = malloc(screen_backupsize(t_lines, big_picture)); - screen_backup(t_lines, big_picture, &old_screen); - getyx(&y, &x); + screen_backup(&old_screen); my_newfd = i_newfd; i_newfd = 0; my_write2(); - screen_restore(t_lines, big_picture, &old_screen); - free(old_screen.raw_memory); + screen_restore(&old_screen); i_newfd = my_newfd; - move(y, x); - redoscr(); continue; } else if (!WATERMODE(WATER_OFO)) { if (watermode > 0) { @@ -494,10 +484,8 @@ igetch(void) } else if (watermode == -1 && currutmp->msgs[0].pid) { /* 第一次按 Ctrl-R (必須先被丟過水球) */ screen_backup_t old_screen; - int y, x, my_newfd; - getyx(&y, &x); - old_screen.raw_memory = malloc(screen_backupsize(t_lines, big_picture)); - screen_backup(t_lines, big_picture, &old_screen); + int my_newfd; + screen_backup(&old_screen); /* 如果正在talk的話先不處理對方送過來的封包 (不去select) */ my_newfd = i_newfd; @@ -527,10 +515,7 @@ igetch(void) i_newfd = my_newfd; /* 還原螢幕 */ - screen_restore(t_lines, big_picture, &old_screen); - free(old_screen.raw_memory); - move(y, x); - redoscr(); + screen_restore(&old_screen); continue; } } |