* src/gdb/utils.c (init_page_info): Only call tgetnum function
authorPierre Muller <muller@sourceware.org>
Tue, 13 Aug 2013 08:31:20 +0000 (08:31 +0000)
committerPierre Muller <muller@sourceware.org>
Tue, 13 Aug 2013 08:31:20 +0000 (08:31 +0000)
if rl_get_screen_size did not return useful values.

gdb/ChangeLog
gdb/utils.c

index 3691ba3ff74fe30a5e29a1afa0f11ce8d80b150b..22fb07caca4bde700bc5b517f93786d1420cc4b7 100644 (file)
@@ -1,3 +1,8 @@
+2013-08-13  Pierre Muller  <muller@sourceware.org>
+
+       * 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  <ali_anwar@codesourcery.com>
 
        PR breakpoints/15117
index 61d502304b47d948098aedc99f7284006334f243..06521977d15753d54a715d03405b9946be93f58f 100644 (file)
@@ -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;
        }
 
This page took 0.029245 seconds and 4 git commands to generate.