summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-input.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-05-31 07:55:17 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-05-31 07:55:17 +0000
commit4d4a667094f72ddc246697d09fda0fb2d4abab74 (patch)
tree434618de480d14b43d3d3b3bf7e7a2a697bab513 /src/gui/curses/gui-input.c
parent0eb3d45582c6c7f8187a5adc8a61fcfa2bef46c6 (diff)
downloadweechat-4d4a667094f72ddc246697d09fda0fb2d4abab74.zip
Fixed crash when using alt-S or alt-X keys on DCC buffer (alt-D)
Diffstat (limited to 'src/gui/curses/gui-input.c')
-rw-r--r--src/gui/curses/gui-input.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/gui/curses/gui-input.c b/src/gui/curses/gui-input.c
index 245e0dd10..89793d4ee 100644
--- a/src/gui/curses/gui-input.c
+++ b/src/gui/curses/gui-input.c
@@ -519,33 +519,39 @@ gui_read_keyb ()
/* Alt-S: jump to server buffer */
case 's':
case 'S':
- if (SERVER(gui_current_window->buffer)->buffer !=
- gui_current_window->buffer)
+ if (!gui_current_window->buffer->dcc)
{
- gui_switch_to_buffer (gui_current_window,
- SERVER(gui_current_window->buffer)->buffer);
- gui_redraw_buffer (gui_current_window->buffer);
+ if (SERVER(gui_current_window->buffer)->buffer !=
+ gui_current_window->buffer)
+ {
+ gui_switch_to_buffer (gui_current_window,
+ SERVER(gui_current_window->buffer)->buffer);
+ gui_redraw_buffer (gui_current_window->buffer);
+ }
}
break;
/* Alt-X: jump to first channel/private of next server */
case 'x':
case 'X':
- ptr_server = SERVER(gui_current_window->buffer)->next_server;
- if (!ptr_server)
- ptr_server = irc_servers;
- while (ptr_server != SERVER(gui_current_window->buffer))
- {
- if (ptr_server->buffer)
- break;
- ptr_server = (ptr_server->next_server) ?
- ptr_server->next_server : irc_servers;
- }
- if (ptr_server != SERVER(gui_current_window->buffer))
+ if (!gui_current_window->buffer->dcc)
{
- ptr_buffer = (ptr_server->channels) ?
- ptr_server->channels->buffer : ptr_server->buffer;
- gui_switch_to_buffer (gui_current_window, ptr_buffer);
- gui_redraw_buffer (gui_current_window->buffer);
+ ptr_server = SERVER(gui_current_window->buffer)->next_server;
+ if (!ptr_server)
+ ptr_server = irc_servers;
+ while (ptr_server != SERVER(gui_current_window->buffer))
+ {
+ if (ptr_server->buffer)
+ break;
+ ptr_server = (ptr_server->next_server) ?
+ ptr_server->next_server : irc_servers;
+ }
+ if (ptr_server != SERVER(gui_current_window->buffer))
+ {
+ ptr_buffer = (ptr_server->channels) ?
+ ptr_server->channels->buffer : ptr_server->buffer;
+ gui_switch_to_buffer (gui_current_window, ptr_buffer);
+ gui_redraw_buffer (gui_current_window->buffer);
+ }
}
break;
}