1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

really_close_tab(): call number_of_tabs() only if needed.

This commit is contained in:
Laurent MONIN 2005-09-17 20:14:33 +02:00 committed by Laurent MONIN
parent 8d234b242b
commit a9f70fd776

View File

@ -159,12 +159,14 @@ static void
really_close_tab(struct session *ses)
{
struct terminal *term = ses->tab->term;
int num_tabs = number_of_tabs(term);
struct window *current_tab = get_current_tab(term);
if (ses->tab == current_tab)
switch_to_tab(term, term->current_tab - 1, num_tabs - 1);
if (ses->tab == current_tab) {
int num_tabs = number_of_tabs(term);
switch_to_tab(term, term->current_tab - 1, num_tabs - 1);
}
delete_window(ses->tab);
}