summaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2013-08-13 08:31:20 +0000
committerPierre Muller <muller@ics.u-strasbg.fr>2013-08-13 08:31:20 +0000
commit8ae22f69d18b5e9fff85fa205dd9b9389a4b5481 (patch)
tree9851b97a5cb3203285aaf1da362752aa206febd6 /gdb/utils.c
parent5a20845009c184687372bb2c0cd47641fa47ba02 (diff)
downloadgdb-8ae22f69d18b5e9fff85fa205dd9b9389a4b5481.tar.gz
* 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 61d502304b4..06521977d15 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;
}