mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:52:54 +00:00
[NTVDM]: Correctly compute the command-line length to be communicated to COMMAND.COM for standalone mode.
svn path=/trunk/; revision=69767
This commit is contained in:
parent
99356ff25a
commit
feadd48d1c
1 changed files with 6 additions and 8 deletions
|
@ -378,20 +378,18 @@ Command:
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Compute the command line length, not counting the terminating "\r\n" */
|
||||||
CmdLen = strlen(CmdLine);
|
CmdLen = strlen(CmdLine);
|
||||||
DPRINT1("Starting '%s' ('%.*s')...\n",
|
if (CmdLen >= 2 && CmdLine[CmdLen - 2] == '\r')
|
||||||
AppName,
|
CmdLen -= 2;
|
||||||
/* Display the command line without the terminating 0d 0a (and skip the terminating NULL) */
|
|
||||||
CmdLen >= 2 ? (CmdLine[CmdLen - 2] == '\r' ? CmdLen - 2
|
DPRINT1("Starting '%s' ('%.*s')...\n", AppName, CmdLen, CmdLine);
|
||||||
: CmdLen)
|
|
||||||
: CmdLen,
|
|
||||||
CmdLine);
|
|
||||||
|
|
||||||
/* Start the process */
|
/* Start the process */
|
||||||
// FIXME: Merge 'Env' with the master environment SEG_OFF_TO_PTR(SYSTEM_ENV_BLOCK, 0)
|
// FIXME: Merge 'Env' with the master environment SEG_OFF_TO_PTR(SYSTEM_ENV_BLOCK, 0)
|
||||||
// FIXME: Environment
|
// FIXME: Environment
|
||||||
RtlCopyMemory(SEG_OFF_TO_PTR(DataStruct->AppNameSeg, DataStruct->AppNameOff), AppName, MAX_PATH);
|
RtlCopyMemory(SEG_OFF_TO_PTR(DataStruct->AppNameSeg, DataStruct->AppNameOff), AppName, MAX_PATH);
|
||||||
*(PBYTE)(SEG_OFF_TO_PTR(DataStruct->CmdLineSeg, DataStruct->CmdLineOff)) = (BYTE)(strlen(CmdLine) - 2);
|
*(PBYTE)(SEG_OFF_TO_PTR(DataStruct->CmdLineSeg, DataStruct->CmdLineOff)) = (BYTE)CmdLen;
|
||||||
RtlCopyMemory(SEG_OFF_TO_PTR(DataStruct->CmdLineSeg, DataStruct->CmdLineOff + 1), CmdLine, DOS_CMDLINE_LENGTH);
|
RtlCopyMemory(SEG_OFF_TO_PTR(DataStruct->CmdLineSeg, DataStruct->CmdLineOff + 1), CmdLine, DOS_CMDLINE_LENGTH);
|
||||||
|
|
||||||
#ifndef STANDALONE
|
#ifndef STANDALONE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue