_tcscpy(err, bc->Err);
}
-
/* Set up the initial conditions ... */
/* preserve STDIN, STDOUT and STDERR handles */
hOldConIn = GetStdHandle (STD_INPUT_HANDLE);
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
- if (bc)
- {
- /* will fail for windows gui apps */
- num = 0;
- bc->hBatchFile = INVALID_HANDLE_VALUE;
- }
- else
- {
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, in);
- return;
- }
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
+ ConErrPrintf(szMsg, in);
+ return;
}
if (!SetStdHandle (STD_INPUT_HANDLE, hFile))
/* Now set up the end conditions... */
/* redirect STDOUT */
- if ((bc) && (bc->hBatchFile != INVALID_HANDLE_VALUE) && (out[0]))
+ if (out[0])
{
/* Final output to here */
HANDLE hFile;
}
/* redirect STDERR */
- if ((bc) && (bc->hBatchFile != INVALID_HANDLE_VALUE) && (err[0]))
+ if (err[0])
{
/* Final output to here */
HANDLE hFile;
if (i > 0)
{
if (StringPart[1] < 0)
- StringPart[1] = _tcslen(ret + StringPart[0]) - 1 + StringPart[1];
+ StringPart[1] = _tcslen(ret + StringPart[0]) + StringPart[1];
_tcsncpy(ReturnValue, ret + StringPart[0], StringPart[1]);
_tcscpy(ret, ReturnValue);
}
if (_tcsncicmp(varName, _T("dp0"), 3) == 0)
{
if ( varNameLen )
- *varNameLen = 4;
- varName += 2;
+ *varNameLen = 5;
return bc->BatchFilePath;
}
case _T('0'):
}
}
- if (_istcntrl (*ip))
+ if (*ip != _T('\0') && (_istcntrl (*ip)))
*ip = _T(' ');
*cp++ = *ip++;
*cp = _T('\0');
- /* strip trailing spaces */
- while ((--cp >= commandline) && _istspace (*cp));
-
- *(cp + 1) = _T('\0');
-
/* JPP 19980807 */
/* Echo batch file line */
if (bEchoThisLine)
InitLastPath ();
#endif
-#ifdef FATURE_ALIASES
- InitializeAlias ();
-#endif
-
if (argc >= 2)
{
for (i = 1; i < argc; i++)
_T(KERNEL_RELEASE_STR),
_T(KERNEL_VERSION_BUILD_STR));
- ConOutPuts (_T("(C) Copyright 1998-" COPYRIGHT_YEAR " ReactOS Team.\n"));
+ ConOutPuts (_T("(C) Copyright 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team.\n"));
}
ExecuteAutoRunFile ();
ParseCommandLine (_T("\\cmdexit.bat"));
}
-#ifdef FEATURE_ALIASES
- DestroyAlias ();
-#endif
-
#ifdef FEATURE_DIECTORY_STACK
/* destroy directory stack */
DestroyDirectoryStack ();