* fhandler_console.cc (fhandler_console::dup): Allocate space for
savebuf on Cygwin heap. (fhandler_console::char_command): Ditto. Use correct values for size.
This commit is contained in:
parent
149da470f3
commit
235661a37f
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue