https://git.reactos.org/?p=reactos.git;a=commitdiff;h=682875d070d7475b3f07d…
commit 682875d070d7475b3f07d56ef30f3dcf06d2c052
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Jul 12 17:48:13 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 19 20:36:09 2020 +0200
[CMD] TIME: The /T option is available only when extensions are enabled.
And merge two string buffers into one.
---
base/shell/cmd/time.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/base/shell/cmd/time.c b/base/shell/cmd/time.c
index 16bb9aae58b..c53abbf11bf 100644
--- a/base/shell/cmd/time.c
+++ b/base/shell/cmd/time.c
@@ -135,8 +135,7 @@ INT cmd_time(LPTSTR param)
INT argc;
INT i;
INT nTimeString = -1;
- TCHAR szTime[20];
- TCHAR s[40];
+ TCHAR szTime[40];
if (!_tcsncmp(param, _T("/?"), 2))
{
@@ -152,7 +151,7 @@ INT cmd_time(LPTSTR param)
/* Check for options */
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 */
SYSTEMTIME st;
@@ -178,14 +177,14 @@ INT cmd_time(LPTSTR param)
if (nTimeString == -1)
{
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(' '))
- s[_tcslen(s) - 1] = _T('\0');
+ while (*szTime && szTime[_tcslen(szTime) - 1] < _T(' '))
+ szTime[_tcslen(szTime) - 1] = _T('\0');
- if (ParseTime(s))
+ if (ParseTime(szTime))
{
freep(arg);
return 0;