From: Pierre Muller Date: Tue, 13 Aug 2013 08:31:20 +0000 (+0000) Subject: * src/gdb/utils.c (init_page_info): Only call tgetnum function X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=1a66331ea18b3a1300c22f984052569b67dd5164;p=deliverable%2Fbinutils-gdb.git * src/gdb/utils.c (init_page_info): Only call tgetnum function if rl_get_screen_size did not return useful values. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3691ba3ff7..22fb07caca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-08-13 Pierre Muller + + * src/gdb/utils.c (init_page_info): Only call tgetnum function + if rl_get_screen_size did not return useful values. + 2013-08-12 Ali Anwar PR breakpoints/15117 diff --git a/gdb/utils.c b/gdb/utils.c index 61d502304b..06521977d1 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1660,12 +1660,16 @@ init_page_info (void) lines_per_page = rows; chars_per_line = cols; - /* Readline should have fetched the termcap entry for us. */ - if (tgetnum ("li") < 0 || getenv ("EMACS")) + /* Readline should have fetched the termcap entry for us. + Only try to use tgetnum function if rl_get_screen_size + did not return a useful value. */ + if (((rows <= 0) && (tgetnum ("li") < 0)) + /* Also disable paging if inside EMACS. */ + || getenv ("EMACS")) { - /* The number of lines per page is not mentioned in the - terminal description. This probably means that paging is - not useful (e.g. emacs shell window), so disable paging. */ + /* The number of lines per page is not mentioned in the terminal + description or EMACS evironment variable is set. This probably + means that paging is not useful, so disable paging. */ lines_per_page = UINT_MAX; }