mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05: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:
parent
57493acd39
commit
2968d45f82
@ -93,15 +93,18 @@ static void handle_entry_redirect(const char *line)
|
|||||||
static int get_scroll_count(void)
|
static int get_scroll_count(void)
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
int count;
|
double count;
|
||||||
|
|
||||||
str = settings_get_str("scroll_page_count");
|
str = settings_get_str("scroll_page_count");
|
||||||
count = atoi(str + (*str == '/'));
|
count = atof(str + (*str == '/'));
|
||||||
if (count < 0) count = 1;
|
if (count <= 0)
|
||||||
|
count = 1;
|
||||||
|
else if (count < 1)
|
||||||
|
count = 1.0/count;
|
||||||
|
|
||||||
if (*str == '/')
|
if (*str == '/')
|
||||||
count = WINDOW_GUI(active_win)->parent->lines/count;
|
count = WINDOW_GUI(active_win)->parent->lines/count;
|
||||||
return count;
|
return (int)count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_prev_page(void)
|
static void window_prev_page(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user