diff options
Diffstat (limited to 'src/irc.c')
| -rw-r--r-- | src/irc.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -782,10 +782,12 @@ static char cur_is_query(void) { } */ -char find_scr(int status) { - char i; +/* count backwards here, because the [server] screen is 0, it's + the least interesting one. */ +char find_scr_with_status(int status) { + signed char i; - for(i = 0; i < MAX_SCREENS; i++) { + for(i = MAX_SCREENS - 1; i != -1; i--) { if(scr_status[i] == status) { return i; } @@ -796,9 +798,9 @@ char find_scr(int status) { void switch_to_active() { char i; - i = find_scr(SCR_HILITE); + i = find_scr_with_status(SCR_HILITE); if(i == 0xff) - i = find_scr(SCR_ACTIVE); + i = find_scr_with_status(SCR_ACTIVE); if(i != 0xff) { scr_prev = scr_current; scr_display(i); |
