mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 03:56:41 +00:00
- fix cmd not to crash when just typing "start" [enter]
See issue #2294 for more details. svn path=/trunk/; revision=27955
This commit is contained in:
parent
0a931f1a75
commit
c697530b17
1 changed files with 3 additions and 3 deletions
|
@ -97,7 +97,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
SetLastError(0);
|
SetLastError(0);
|
||||||
size = GetEnvironmentVariable (_T("COMSPEC"), comspec, 512);
|
size = GetEnvironmentVariable (_T("COMSPEC"), comspec, MAX_PATH);
|
||||||
if(GetLastError() == ERROR_ENVVAR_NOT_FOUND)
|
if(GetLastError() == ERROR_ENVVAR_NOT_FOUND)
|
||||||
{
|
{
|
||||||
RestWithoutArgs[0] = _T('c');
|
RestWithoutArgs[0] = _T('c');
|
||||||
|
@ -127,7 +127,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest)
|
||||||
_tcscat(RestWithoutArgs,_T("\""));
|
_tcscat(RestWithoutArgs,_T("\""));
|
||||||
}
|
}
|
||||||
|
|
||||||
rest = malloc ( _tcslen(RestWithoutArgs) + 1 * sizeof(TCHAR));
|
rest = malloc ( (_tcslen(RestWithoutArgs) + 1) * sizeof(TCHAR));
|
||||||
if (rest == NULL)
|
if (rest == NULL)
|
||||||
{
|
{
|
||||||
if(comspec != NULL)
|
if(comspec != NULL)
|
||||||
|
@ -136,7 +136,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
param =malloc ( _tcslen(RestWithoutArgs) + 1 * sizeof(TCHAR));
|
param =malloc ( (_tcslen(RestWithoutArgs) + 1) * sizeof(TCHAR));
|
||||||
if (rest == NULL)
|
if (rest == NULL)
|
||||||
{
|
{
|
||||||
if(comspec != NULL)
|
if(comspec != NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue