DosReadFile echoes the line feed when it encounters it.
A backspace should delete the '^' sign for special characters.


svn path=/trunk/; revision=69360
This commit is contained in:
Aleksandar Andrejevic
2015-09-26 02:51:37 +00:00
parent acfe187655
commit 6a44a622b4
2 changed files with 21 additions and 13 deletions
@@ -53,15 +53,6 @@ VOID DosEchoCharacter(CHAR Character)
break;
}
case '\r':
case '\n':
{
/* Print both a carriage return and a newline */
DosPrintCharacter(DOS_OUTPUT_HANDLE, '\r');
DosPrintCharacter(DOS_OUTPUT_HANDLE, '\n');
break;
}
case '\b':
{
/* Erase the character */
@@ -73,8 +64,11 @@ VOID DosEchoCharacter(CHAR Character)
default:
{
/* Check if this is a special character */
if (Character < 0x20)
/*
* Check if this is a special character
* NOTE: \r and \n are handled by the underlying driver!
*/
if (Character < 0x20 && Character != 0x0A && Character != 0x0D)
{
DosPrintCharacter(DOS_OUTPUT_HANDLE, '^');
Character += 'A' - 1;
@@ -725,14 +725,25 @@ BYTE DosReadLineBuffered(WORD FileHandle, DWORD Buffer, BYTE MaxSize)
break;
}
case '\n':
{
DosEchoCharacter('\r');
DosEchoCharacter('\n');
break;
}
case '\b':
{
if (LineSize > 0)
{
LineSize--;
if (Pointer[LineSize] == 0) LineSize--;
DosEchoCharacter(Character);
/* Erase the '^' too */
if (Pointer[LineSize] > 0x00 && Pointer[LineSize] < 0x20)
{
DosEchoCharacter(Character);
}
}
break;
@@ -813,6 +824,9 @@ WORD DosReadFile(WORD FileHandle,
{
/* A line feed marks the true end of the line */
SysVars->UnreadConInput = 0;
/* Echo the line feed */
DosEchoCharacter('\n');
break;
}
else