1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-15 04:28:09 -04:00

/SET scroll_page_count - don't crash if /0 is given. Works now properly

if /0.xx is given.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1364 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-03-08 00:27:40 +00:00 committed by cras
parent 57493acd39
commit 2968d45f82

View File

@ -93,15 +93,18 @@ static void handle_entry_redirect(const char *line)
static int get_scroll_count(void)
{
const char *str;
int count;
double count;
str = settings_get_str("scroll_page_count");
count = atoi(str + (*str == '/'));
if (count < 0) count = 1;
count = atof(str + (*str == '/'));
if (count <= 0)
count = 1;
else if (count < 1)
count = 1.0/count;
if (*str == '/')
count = WINDOW_GUI(active_win)->parent->lines/count;
return count;
return (int)count;
}
static void window_prev_page(void)