Don't interpret \\r\\n as 2 newlines.

svn path=/trunk/; revision=10229
This commit is contained in:
Gregor Anich 2004-07-19 19:40:01 +00:00
parent 7497d9c86e
commit 10b4b57ad4

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: kdb.c,v 1.22 2004/05/04 21:16:51 navaraf Exp $ /* $Id: kdb.c,v 1.23 2004/07/19 19:40:01 blight Exp $
* *
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/dbg/kdb.c * FILE: ntoskrnl/dbg/kdb.c
@ -262,6 +262,7 @@ KdbGetCommand(PCH Buffer)
PCH Orig = Buffer; PCH Orig = Buffer;
static UCHAR LastCommand[256] = ""; static UCHAR LastCommand[256] = "";
ULONG ScanCode = 0; ULONG ScanCode = 0;
static CHAR LastKey = '\0';
KbdEchoOn = !((KdDebugState & KD_DEBUG_KDNOECHO) != 0); KbdEchoOn = !((KdDebugState & KD_DEBUG_KDNOECHO) != 0);
@ -272,7 +273,11 @@ KdbGetCommand(PCH Buffer)
else else
while ((Key = KdbTryGetCharKeyboard(&ScanCode)) == -1); while ((Key = KdbTryGetCharKeyboard(&ScanCode)) == -1);
if (Key == '\r' || Key == '\n') if (Key == '\n' && LastKey == '\r')
{
/* Ignore this key... */
}
else if (Key == '\r' || Key == '\n')
{ {
DbgPrint("\n"); DbgPrint("\n");
/* /*
@ -288,6 +293,7 @@ KdbGetCommand(PCH Buffer)
*Buffer = 0; *Buffer = 0;
strcpy(LastCommand, Orig); strcpy(LastCommand, Orig);
} }
LastKey = Key;
return; return;
} }
else if (Key == BS || Key == DEL) else if (Key == BS || Key == DEL)
@ -330,6 +336,7 @@ KdbGetCommand(PCH Buffer)
*Buffer = Key; *Buffer = Key;
Buffer++; Buffer++;
} }
LastKey = Key;
} }
} }