mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[CMD] TIME: The /T option is available only when extensions are enabled.
And merge two string buffers into one.
This commit is contained in:
parent
aab632644f
commit
682875d070
1 changed files with 7 additions and 8 deletions
|
@ -135,8 +135,7 @@ INT cmd_time(LPTSTR param)
|
||||||
INT argc;
|
INT argc;
|
||||||
INT i;
|
INT i;
|
||||||
INT nTimeString = -1;
|
INT nTimeString = -1;
|
||||||
TCHAR szTime[20];
|
TCHAR szTime[40];
|
||||||
TCHAR s[40];
|
|
||||||
|
|
||||||
if (!_tcsncmp(param, _T("/?"), 2))
|
if (!_tcsncmp(param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
@ -152,7 +151,7 @@ INT cmd_time(LPTSTR param)
|
||||||
/* Check for options */
|
/* Check for options */
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
if (_tcsicmp(arg[i], _T("/t")) == 0)
|
if (bEnableExtensions && (_tcsicmp(arg[i], _T("/T")) == 0))
|
||||||
{
|
{
|
||||||
/* Display current time in short format */
|
/* Display current time in short format */
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
|
@ -178,14 +177,14 @@ INT cmd_time(LPTSTR param)
|
||||||
if (nTimeString == -1)
|
if (nTimeString == -1)
|
||||||
{
|
{
|
||||||
ConOutResPuts(STRING_TIME_HELP2);
|
ConOutResPuts(STRING_TIME_HELP2);
|
||||||
ConInString(s, ARRAYSIZE(s));
|
ConInString(szTime, ARRAYSIZE(szTime));
|
||||||
|
|
||||||
TRACE("\'%s\'\n", debugstr_aw(s));
|
TRACE("\'%s\'\n", debugstr_aw(szTime));
|
||||||
|
|
||||||
while (*s && s[_tcslen(s) - 1] < _T(' '))
|
while (*szTime && szTime[_tcslen(szTime) - 1] < _T(' '))
|
||||||
s[_tcslen(s) - 1] = _T('\0');
|
szTime[_tcslen(szTime) - 1] = _T('\0');
|
||||||
|
|
||||||
if (ParseTime(s))
|
if (ParseTime(szTime))
|
||||||
{
|
{
|
||||||
freep(arg);
|
freep(arg);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue