[XCOPY] Sync with Wine Staging 2.9. CORE-13362

373604f xcopy: Avoid using isdigit() for WCHARs.

svn path=/trunk/; revision=74772
This commit is contained in:
Amine Khaldi 2017-06-03 17:28:54 +00:00
parent 70740f2a14
commit 6b4d06cee9
2 changed files with 11 additions and 6 deletions

View File

@ -648,7 +648,7 @@ cleanup:
/* =========================================================================
XCOPY_ParseCommandLine - Parses the command line
========================================================================= */
static BOOL is_whitespace(WCHAR c)
static inline BOOL is_whitespace(WCHAR c)
{
return c == ' ' || c == '\t';
}
@ -659,6 +659,11 @@ static WCHAR *skip_whitespace(WCHAR *p)
return p;
}
static inline BOOL is_digit(WCHAR c)
{
return c >= '0' && c <= '9';
}
/* Windows XCOPY uses a simplified command line parsing algorithm
that lacks the escaped-quote logic of build_argv(), because
literal double quotes are illegal in any of its arguments.
@ -775,7 +780,7 @@ static int XCOPY_ParseCommandLine(WCHAR *suppliedsource,
break;
/* D can be /D or /D: */
case 'D': if (word[2]==':' && isdigit(word[3])) {
case 'D': if (word[2]==':' && is_digit(word[3])) {
SYSTEMTIME st;
WCHAR *pos = &word[3];
BOOL isError = FALSE;
@ -786,18 +791,18 @@ static int XCOPY_ParseCommandLine(WCHAR *suppliedsource,
* It is hardcoded to month-day-year.
*/
st.wMonth = _wtol(pos);
while (*pos && isdigit(*pos)) pos++;
while (*pos && is_digit(*pos)) pos++;
if (*pos++ != '-') isError = TRUE;
if (!isError) {
st.wDay = _wtol(pos);
while (*pos && isdigit(*pos)) pos++;
while (*pos && is_digit(*pos)) pos++;
if (*pos++ != '-') isError = TRUE;
}
if (!isError) {
st.wYear = _wtol(pos);
while (*pos && isdigit(*pos)) pos++;
while (*pos && is_digit(*pos)) pos++;
if (st.wYear < 100) st.wYear+=2000;
}

View File

@ -232,7 +232,7 @@ reactos/base/applications/cmdutils/schtasks # Synced to WineStaging-1.9.14
reactos/base/applications/cmdutils/taskkill # Synced to WineStaging-1.9.11
reactos/base/applications/cmdutils/wmic # Synced to WineStaging-2.2
reactos/base/applications/cmdutils/wscript # Synced to WineStaging-1.9.16
reactos/base/applications/cmdutils/xcopy # Synced to WineStaging-1.9.11
reactos/base/applications/cmdutils/xcopy # Synced to WineStaging-2.9
reactos/base/applications/games/winmine # Synced to WineStaging-1.9.16 with our own resources.
reactos/base/applications/extrac32 # Synced to WineStaging-1.9.11
reactos/base/applications/iexplore # Synced to WineStaging-1.9.11