Author: aandrejevic
Date: Sat Sep 26 02:51:37 2015
New Revision: 69360
URL: http://svn.reactos.org/svn/reactos?rev=69360&view=rev
Log:
[NTVDM]
DosReadFile echoes the line feed when it encounters it.
A backspace should delete the '^' sign for special characters.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] Sat Sep 26 02:51:37 2015
@@ -53,15 +53,6 @@
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 @@
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;
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] Sat Sep 26 02:51:37 2015
@@ -725,14 +725,25 @@
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 @@
{
/* A line feed marks the true end of the line */
SysVars->UnreadConInput = 0;
+
+ /* Echo the line feed */
+ DosEchoCharacter('\n');
break;
}
else