mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
Fixed bugs in batch file execution.
svn path=/trunk/; revision=496
This commit is contained in:
parent
d22c45fab2
commit
42dfa65049
7 changed files with 26 additions and 9 deletions
|
@ -60,7 +60,7 @@ static VOID
|
|||
partstrlwr (LPTSTR str)
|
||||
{
|
||||
LPTSTR c = str;
|
||||
while (*c && !_istspace (*c))
|
||||
while (*c && !_istspace (*c) && *c != _T('='))
|
||||
{
|
||||
*c = _totlower (*c);
|
||||
c++;
|
||||
|
|
|
@ -76,6 +76,10 @@ INT cmd_path (LPTSTR cmd, LPTSTR param)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* skip leading '=' */
|
||||
if (*param == _T('='))
|
||||
param++;
|
||||
|
||||
/* set PATH environment variable */
|
||||
if (!SetEnvironmentVariable (_T("PATH"), param))
|
||||
return 1;
|
||||
|
|
|
@ -71,7 +71,7 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags
|
|||
|
||||
do
|
||||
*dp++ = *sp++;
|
||||
while (*sp != qc);
|
||||
while (*sp && *sp != qc);
|
||||
|
||||
*dp++ = *sp++;
|
||||
}
|
||||
|
@ -197,13 +197,13 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags
|
|||
|
||||
do
|
||||
sp++;
|
||||
while (*sp != qc);
|
||||
while (*sp && *sp != qc);
|
||||
|
||||
sp++;
|
||||
}
|
||||
else if (*sp == _T('|'))
|
||||
{
|
||||
*sp++ = '\0';
|
||||
*sp++ = _T('\0');
|
||||
num++;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -60,7 +60,7 @@ static VOID
|
|||
partstrlwr (LPTSTR str)
|
||||
{
|
||||
LPTSTR c = str;
|
||||
while (*c && !_istspace (*c))
|
||||
while (*c && !_istspace (*c) && *c != _T('='))
|
||||
{
|
||||
*c = _totlower (*c);
|
||||
c++;
|
||||
|
|
|
@ -944,6 +944,16 @@ static VOID Initialize (int argc, char *argv[])
|
|||
if (argv)
|
||||
SetEnvironmentVariable (_T("COMSPEC"), argv[0]);
|
||||
#endif
|
||||
ConOutPrintf("argc: %d\n", argc);
|
||||
if (!argv)
|
||||
{
|
||||
ConOutPrintf("argc is NULL\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* add ctrl handler */
|
||||
#if 0
|
||||
|
@ -998,5 +1008,4 @@ int main (int argc, char *argv[])
|
|||
FreeConsole ();
|
||||
|
||||
return nExitCode;
|
||||
// return 0;
|
||||
}
|
||||
|
|
|
@ -76,6 +76,10 @@ INT cmd_path (LPTSTR cmd, LPTSTR param)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* skip leading '=' */
|
||||
if (*param == _T('='))
|
||||
param++;
|
||||
|
||||
/* set PATH environment variable */
|
||||
if (!SetEnvironmentVariable (_T("PATH"), param))
|
||||
return 1;
|
||||
|
|
|
@ -71,7 +71,7 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags
|
|||
|
||||
do
|
||||
*dp++ = *sp++;
|
||||
while (*sp != qc);
|
||||
while (*sp && *sp != qc);
|
||||
|
||||
*dp++ = *sp++;
|
||||
}
|
||||
|
@ -197,13 +197,13 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags
|
|||
|
||||
do
|
||||
sp++;
|
||||
while (*sp != qc);
|
||||
while (*sp && *sp != qc);
|
||||
|
||||
sp++;
|
||||
}
|
||||
else if (*sp == _T('|'))
|
||||
{
|
||||
*sp++ = '\0';
|
||||
*sp++ = _T('\0');
|
||||
num++;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue