Francois Gouget : oleaut32: Fix VarParseNumFromStr()'s support for trailing thousands separator spaces.
Alexandre Julliard
julliard at winehq.org
Fri Feb 25 07:30:23 CST 2022
Module: wine
Branch: oldstable
Commit: c8dc029d412a0360c70ff0fef9ba908b0d0f6eec
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c8dc029d412a0360c70ff0fef9ba908b0d0f6eec
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Jul 22 00:03:49 2021 +0200
oleaut32: Fix VarParseNumFromStr()'s support for trailing thousands separator spaces.
If a trailing character is a thousands separator, VarParseNumFromStr()
only processes it if NUMPRS_THOUSANDS was specified; even if that
character is also a space and NUMPRS_TRAILING_WHITE was specified.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit c2aeb915f4fc05d596aec0ff43f5e5f26569cd21)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/oleaut32/tests/vartest.c | 4 ++--
dlls/oleaut32/variant.c | 17 ++++++++++++++++-
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c
index 7aaec0ef80a..7030771c78f 100644
--- a/dlls/oleaut32/tests/vartest.c
+++ b/dlls/oleaut32/tests/vartest.c
@@ -1902,7 +1902,7 @@ static void test_VarParseNumFromStrFr(void)
if (spaces[i] == ' ' || spaces[i] == 0xa0 /* non-breaking space */)
{
/* Spaces aliased to the thousands separator are never allowed! */
- todo_wine EXPECTFAIL;
+ EXPECTFAIL;
}
else
{
@@ -2019,7 +2019,7 @@ static void test_VarParseNumFromStrFr(void)
if (spaces[i] == ' ' || spaces[i] == 0xa0 /* non-breaking space */)
{
/* Spaces aliased to thousands separator are never allowed! */
- todo_wine EXPECTFAIL;
+ EXPECTFAIL;
}
else
{
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index f3fa5d64caf..0f00384aeb2 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -1922,7 +1922,22 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
/* Consume any trailing symbols and space */
while (1)
{
- if ((pNumprs->dwInFlags & NUMPRS_TRAILING_WHITE) && iswspace(*lpszStr))
+ if ((chars.cDigitSeparator && *lpszStr == chars.cDigitSeparator) ||
+ (cDigitSeparator2 && *lpszStr == cDigitSeparator2))
+ {
+ if (pNumprs->dwInFlags & NUMPRS_THOUSANDS)
+ {
+ pNumprs->dwOutFlags |= NUMPRS_THOUSANDS;
+ cchUsed++;
+ lpszStr++;
+ }
+ else
+ {
+ /* Not allowed, even with NUMPRS_TRAILING_WHITE */
+ break;
+ }
+ }
+ else if ((pNumprs->dwInFlags & NUMPRS_TRAILING_WHITE) && iswspace(*lpszStr))
{
pNumprs->dwOutFlags |= NUMPRS_TRAILING_WHITE;
do
More information about the wine-cvs
mailing list