summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-03-08 00:27:40 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-03-08 00:27:40 +0000
commit2968d45f82bfba65efffb5dab4e659f13172653a (patch)
treebf37a8d5424479e5d507c31947c073750d31ce2f /src/fe-text
parent57493acd39f63c20407c098730936a582fd47c51 (diff)
downloadirssi-2968d45f82bfba65efffb5dab4e659f13172653a.zip
/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
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/gui-readline.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c
index f2b18ab9..d7b2d29f 100644
--- a/src/fe-text/gui-readline.c
+++ b/src/fe-text/gui-readline.c
@@ -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)