gdb_test "set width -1" "integer -1 out of range"
gdb_test "set height -1" "integer -1 out of range"
-gdb_exit
-return 0
-
+# A height of 1 used to cause pathological behavior -- it would
+# endlessly prompt for paging without printing anything.
+gdb_test_no_output "set height 1"
+gdb_test "print 23" " = 23"
m_wrap_indent = 0;
});
+ /* If the user does "set height 1" then the pager will exhibit weird
+ behavior. This is pathological, though, so don't allow it. */
+ const unsigned int lines_allowed = (lines_per_page > 1
+ ? lines_per_page - 1
+ : 1);
+
/* Go through and output each character. Show line extension
when this is necessary; prompt user for new page when this is
necessary. */
it here. */
if (pagination_enabled
&& !pagination_disabled_for_command
- && lines_printed >= lines_per_page - 1)
+ && lines_printed >= lines_allowed)
prompt_for_continue ();
while (*lineptr && *lineptr != '\n')
this loop, so we must continue to check it here. */
if (pagination_enabled
&& !pagination_disabled_for_command
- && lines_printed >= lines_per_page - 1)
+ && lines_printed >= lines_allowed)
{
prompt_for_continue ();
did_paginate = true;