From 7bdf8f2e1a0139458222e4e2088435786f9c027c Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 10 Mar 2014 17:33:06 +0000 Subject: [PATCH] * fhandler_console.cc (dev_console::save_restore): Save entire line of current cursor position. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_console.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e206b4add..a3269a715 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-03-10 Christopher Faylor + + * fhandler_console.cc (dev_console::save_restore): Save entire line of + current cursor position. + 2014-03-09 Christopher Faylor * fhandler_console.cc (fhandler_console::save_restore): Save only until diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 53418edf1..ffbda4813 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1457,8 +1457,9 @@ dev_console::save_restore (HANDLE h, char c) if (c == 'h') /* save */ { fillin (h); - save_bufsize.Y = dwEnd.Y + 1; /* Assume starting from 0/0 */ save_bufsize.X = b.dwSize.X; + if ((save_bufsize.Y = dwEnd.Y + 2) > b.dwSize.Y) + save_bufsize.X = b.dwSize.Y; if (save_buf) cfree (save_buf);