diff options
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0a3a208..9d89460 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Tue Jun 5 19:56:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::dup): Allocate space for + savebuf on Cygwin heap. + (fhandler_console::char_command): Ditto. Use correct values for size. + 2001-06-05 Egor Duda <deo@logos-m.ru> * security.h (NTWriteEA): Change prototype. diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index b6408e5..cf95ecc 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -624,7 +624,7 @@ fhandler_console::dup (fhandler_base *child) fhc->savebufsiz = savebufsiz; if (savebuf) { - fhc->savebuf = (PCHAR_INFO) malloc (sizeof (CHAR_INFO) * + fhc->savebuf = (PCHAR_INFO) cmalloc (HEAP_1_BUF, sizeof (CHAR_INFO) * savebufsiz.X * savebufsiz.Y); memcpy (fhc->savebuf, savebuf, sizeof (CHAR_INFO) * savebufsiz.X * savebufsiz.Y); @@ -1174,12 +1174,12 @@ fhandler_console::char_command (char c) if (!GetConsoleScreenBufferInfo (get_output_handle (), &now)) break; - savebufsiz.X = now.srWindow.Right - now.srWindow.Left; - savebufsiz.Y = now.srWindow.Bottom - now.srWindow.Top; + savebufsiz.X = now.srWindow.Right - now.srWindow.Left + 1; + savebufsiz.Y = now.srWindow.Bottom - now.srWindow.Top + 1; if (savebuf) - free (savebuf); - savebuf = (PCHAR_INFO) malloc (sizeof (CHAR_INFO) * + cfree (savebuf); + savebuf = (PCHAR_INFO) cmalloc (HEAP_1_BUF, sizeof (CHAR_INFO) * savebufsiz.X * savebufsiz.Y); ReadConsoleOutputA (get_output_handle (), savebuf, @@ -1199,7 +1199,7 @@ fhandler_console::char_command (char c) WriteConsoleOutputA (get_output_handle (), savebuf, savebufsiz, cob, &now.srWindow); - free (savebuf); + cfree (savebuf); savebuf = NULL; savebufsiz.X = savebufsiz.Y = 0; } |