fix bug in date if the input arg are not right dateformat, it should prom after new date

svn path=/trunk/; revision=16682
This commit is contained in:
Magnus Olsen 2005-07-21 17:24:15 +00:00
parent 58f5ef812e
commit daeb68b5cc

View file

@ -243,13 +243,25 @@ INT cmd_date (LPTSTR cmd, LPTSTR param)
} }
else else
{ {
if (ParseDate (arg[nDateString])) if (!ParseDate (arg[nDateString]))
{ {
freep (arg); while (TRUE) /* forever loop */
return 0; {
} TCHAR s[40];
ConErrResPuts(STRING_DATE_ERROR);
ConErrResPuts(STRING_DATE_ERROR); PrintDateString ();
ConInString (s, 40);
while (*s && s[_tcslen (s) - 1] < _T(' '))
s[_tcslen (s) - 1] = _T('\0');
if (ParseDate (s))
{
freep (arg);
return 0;
}
}
}
} }
freep (arg); freep (arg);