aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2013-08-13 08:31:20 +0000
committerPierre Muller <muller@sourceware.org>2013-08-13 08:31:20 +0000
commit1a66331ea18b3a1300c22f984052569b67dd5164 (patch)
tree2b8129129bd01eb5ad483d4271a1b1ed87b24c01 /gdb/utils.c
parent859e69820724d36af8f91bcb43422f9d34f9a60b (diff)
downloadgdb-1a66331ea18b3a1300c22f984052569b67dd5164.zip
gdb-1a66331ea18b3a1300c22f984052569b67dd5164.tar.gz
gdb-1a66331ea18b3a1300c22f984052569b67dd5164.tar.bz2
* src/gdb/utils.c (init_page_info): Only call tgetnum function
if rl_get_screen_size did not return useful values.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 61d5023..0652197 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;
}