From 4a6251c2977a9d985d656fbeec28a1c116eac1b5 Mon Sep 17 00:00:00 2001 From: Brandon Turner Date: Sat, 22 Jul 2006 05:16:26 +0000 Subject: [PATCH] Revert my backspace patch from before. I found a better way to handle backspaces which doesnt break backspacing in ftp.exe(and some of apps) while still fixing ncftp.exe. svn path=/trunk/; revision=23220 --- .../subsystems/win32/csrss/win32csr/conio.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/reactos/subsystems/win32/csrss/win32csr/conio.c b/reactos/subsystems/win32/csrss/win32csr/conio.c index 805f6572270..e00858bf7f4 100644 --- a/reactos/subsystems/win32/csrss/win32csr/conio.c +++ b/reactos/subsystems/win32/csrss/win32csr/conio.c @@ -607,8 +607,12 @@ CSR_API(CsrReadConsole) && Input->InputEvent.Event.KeyEvent.bKeyDown && Input->InputEvent.Event.KeyEvent.uChar.AsciiChar != '\0') { - /* backspace handling */ - if ('\b' == Input->InputEvent.Event.KeyEvent.uChar.AsciiChar) + /* + * backspace handling - if we are in charge of echoing it then we handle it here + * otherwise we treat it like a normal char. + */ + if ('\b' == Input->InputEvent.Event.KeyEvent.uChar.AsciiChar && 0 + != (Console->Mode & ENABLE_ECHO_INPUT)) { /* echo if it has not already been done, and either we or the client has chars to be deleted */ if (! Input->Echoed @@ -622,14 +626,14 @@ CSR_API(CsrReadConsole) i -= 2; /* if we already have something to return, just back it up by 2 */ } else - { - /* otherwise, we will treat the backspace just like any other char and let the client decide what to do */ + { /* otherwise, return STATUS_NOTIFY_CLEANUP to tell client to back up its buffer */ Console->WaitingChars--; ConioUnlockConsole(Console); HeapFree(Win32CsrApiHeap, 0, Input); - Request->Data.ReadConsoleRequest.NrCharactersRead++; - Buffer[i] = Input->InputEvent.Event.KeyEvent.uChar.AsciiChar; - return Request->Status; + Request->Data.ReadConsoleRequest.NrCharactersRead = 0; + Request->Status = STATUS_NOTIFY_CLEANUP; + return STATUS_NOTIFY_CLEANUP; + } Request->Data.ReadConsoleRequest.nCharsCanBeDeleted--; Input->Echoed = TRUE; /* mark as echoed so we don't echo it below */