Fix style bug when paging
authorTom Tromey <tromey@adacore.com>
Wed, 1 May 2019 17:13:31 +0000 (11:13 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 8 May 2019 16:27:52 +0000 (10:27 -0600)
commitd0e1efa6ae35091a76023bc4e32b6b1e745fa393
treeca3b38f9199ca2e92c229dc7e88e6d7c993869e7
parent4dd5cf12e1d48efbc30faf7328532e27b49860f9
Fix style bug when paging

Philippe pointed out a styling bug that would occur in some conditions
when paging:

    https://sourceware.org/ml/gdb-patches/2019-04/msg00101.html

I was finally able to reproduce this, and this patch fixes the bug.

The problem occurred when text overflowed the line, causing a
pagination prompt, but when no wrap column had been set.  In this
case, the current style was reset to show the prompt, but then not
reset back to the previously applied style before emitting the rest of
the line.

The fix is to record the applied style in this case, and re-apply it
afterward -- but only if the pager prompt was emitted, something that
the existing style.exp pointed out on the first, more naive, version
of the patch.

Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-05-08  Tom Tromey  <tromey@adacore.com>

* utils.c (fputs_maybe_filtered): Reset style after paging, even
when no wrap column is set.
gdb/ChangeLog
gdb/utils.c