mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[CMD] Some code style and formatting fixes
This commit is contained in:
parent
47d7de4b7b
commit
aab632644f
2 changed files with 59 additions and 59 deletions
|
@ -173,30 +173,32 @@ ParseDate (LPTSTR s)
|
|||
}
|
||||
|
||||
|
||||
INT cmd_date (LPTSTR param)
|
||||
INT cmd_date(LPTSTR param)
|
||||
{
|
||||
LPTSTR *arg;
|
||||
INT argc;
|
||||
INT i;
|
||||
BOOL bPrompt = TRUE;
|
||||
INT nDateString = -1;
|
||||
LPTSTR* arg;
|
||||
INT argc;
|
||||
INT i;
|
||||
BOOL bPrompt = TRUE;
|
||||
INT nDateString = -1;
|
||||
TCHAR szDate[40];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
if (!_tcsncmp(param, _T("/?"), 2))
|
||||
{
|
||||
ConOutResPaging(TRUE,STRING_DATE_HELP4);
|
||||
ConOutResPaging(TRUE, STRING_DATE_HELP4);
|
||||
return 0;
|
||||
}
|
||||
|
||||
nErrorLevel = 0;
|
||||
|
||||
/* build parameter array */
|
||||
arg = split (param, &argc, FALSE, FALSE);
|
||||
/* Build the parameter array */
|
||||
arg = split(param, &argc, FALSE, FALSE);
|
||||
|
||||
/* check for options */
|
||||
/* Check for options */
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
if (_tcsicmp (arg[i], _T("/t")) == 0)
|
||||
if (_tcsicmp(arg[i], _T("/t")) == 0)
|
||||
bPrompt = FALSE;
|
||||
|
||||
if ((*arg[i] != _T('/')) && (nDateString == -1))
|
||||
nDateString = i;
|
||||
}
|
||||
|
@ -206,24 +208,25 @@ INT cmd_date (LPTSTR param)
|
|||
|
||||
if (!bPrompt)
|
||||
{
|
||||
freep (arg);
|
||||
freep(arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (nDateString == -1)
|
||||
{
|
||||
while (TRUE) /* forever loop */
|
||||
while (TRUE)
|
||||
{
|
||||
TCHAR s[40];
|
||||
PrintDateString();
|
||||
ConInString(szDate, ARRAYSIZE(szDate));
|
||||
|
||||
PrintDateString ();
|
||||
ConInString (s, 40);
|
||||
TRACE ("\'%s\'\n", debugstr_aw(s));
|
||||
while (*s && s[_tcslen (s) - 1] < _T(' '))
|
||||
s[_tcslen (s) - 1] = _T('\0');
|
||||
if (ParseDate (s))
|
||||
TRACE("\'%s\'\n", debugstr_aw(szDate));
|
||||
|
||||
while (*szDate && szDate[_tcslen(szDate) - 1] < _T(' '))
|
||||
szDate[_tcslen(szDate) - 1] = _T('\0');
|
||||
|
||||
if (ParseDate(szDate))
|
||||
{
|
||||
freep (arg);
|
||||
freep(arg);
|
||||
return 0;
|
||||
}
|
||||
ConErrResPuts(STRING_DATE_ERROR);
|
||||
|
@ -231,28 +234,28 @@ INT cmd_date (LPTSTR param)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!ParseDate (arg[nDateString]))
|
||||
if (!ParseDate(arg[nDateString]))
|
||||
{
|
||||
while (TRUE) /* forever loop */
|
||||
while (TRUE)
|
||||
{
|
||||
TCHAR s[40];
|
||||
ConErrResPuts(STRING_DATE_ERROR);
|
||||
|
||||
PrintDateString ();
|
||||
ConInString (s, 40);
|
||||
PrintDateString();
|
||||
ConInString(szDate, ARRAYSIZE(szDate));
|
||||
|
||||
while (*s && s[_tcslen (s) - 1] < _T(' '))
|
||||
s[_tcslen (s) - 1] = _T('\0');
|
||||
if (ParseDate (s))
|
||||
while (*szDate && szDate[_tcslen(szDate) - 1] < _T(' '))
|
||||
szDate[_tcslen(szDate) - 1] = _T('\0');
|
||||
|
||||
if (ParseDate(szDate))
|
||||
{
|
||||
freep (arg);
|
||||
freep(arg);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
freep (arg);
|
||||
freep(arg);
|
||||
return 0;
|
||||
}
|
||||
#endif /* INCLUDE_CMD_DATE */
|
||||
|
|
|
@ -129,32 +129,33 @@ static BOOL ParseTime (LPTSTR s)
|
|||
}
|
||||
|
||||
|
||||
INT cmd_time (LPTSTR param)
|
||||
INT cmd_time(LPTSTR param)
|
||||
{
|
||||
LPTSTR *arg;
|
||||
INT argc;
|
||||
INT i;
|
||||
INT nTimeString = -1;
|
||||
LPTSTR* arg;
|
||||
INT argc;
|
||||
INT i;
|
||||
INT nTimeString = -1;
|
||||
TCHAR szTime[20];
|
||||
TCHAR s[40];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
if (!_tcsncmp(param, _T("/?"), 2))
|
||||
{
|
||||
ConOutResPaging(TRUE,STRING_TIME_HELP1);
|
||||
ConOutResPaging(TRUE, STRING_TIME_HELP1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
nErrorLevel = 0;
|
||||
|
||||
/* build parameter array */
|
||||
arg = split (param, &argc, FALSE, FALSE);
|
||||
/* Build the parameter array */
|
||||
arg = split(param, &argc, FALSE, FALSE);
|
||||
|
||||
/* check for options */
|
||||
/* Check for options */
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
if (_tcsicmp (arg[i], _T("/t")) == 0)
|
||||
if (_tcsicmp(arg[i], _T("/t")) == 0)
|
||||
{
|
||||
/* Display current time in short format */
|
||||
SYSTEMTIME st;
|
||||
TCHAR szTime[20];
|
||||
GetLocalTime(&st);
|
||||
FormatTime(szTime, &st);
|
||||
ConOutPuts(szTime);
|
||||
|
@ -172,45 +173,41 @@ INT cmd_time (LPTSTR param)
|
|||
ConOutPrintf(_T(": %s\n"), GetTimeString());
|
||||
}
|
||||
|
||||
while (1)
|
||||
while (TRUE)
|
||||
{
|
||||
if (nTimeString == -1)
|
||||
{
|
||||
TCHAR s[40];
|
||||
|
||||
ConOutResPuts(STRING_TIME_HELP2);
|
||||
ConInString(s, ARRAYSIZE(s));
|
||||
|
||||
ConInString (s, 40);
|
||||
TRACE("\'%s\'\n", debugstr_aw(s));
|
||||
|
||||
TRACE ("\'%s\'\n", debugstr_aw(s));
|
||||
|
||||
while (*s && s[_tcslen (s) - 1] < _T(' '))
|
||||
while (*s && s[_tcslen(s) - 1] < _T(' '))
|
||||
s[_tcslen(s) - 1] = _T('\0');
|
||||
|
||||
if (ParseTime (s))
|
||||
if (ParseTime(s))
|
||||
{
|
||||
freep (arg);
|
||||
freep(arg);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ParseTime (arg[nTimeString]))
|
||||
if (ParseTime(arg[nTimeString]))
|
||||
{
|
||||
freep (arg);
|
||||
freep(arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* force input the next time around. */
|
||||
/* Force input the next time around */
|
||||
nTimeString = -1;
|
||||
}
|
||||
|
||||
ConErrResPuts(STRING_TIME_ERROR1);
|
||||
nErrorLevel = 1;
|
||||
nErrorLevel = 1;
|
||||
}
|
||||
|
||||
freep (arg);
|
||||
|
||||
freep(arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue