Alexandre Julliard : oleaut32: Fix handling of 'c' format for non-date variants in VarTokenizeFormatString.

Alexandre Julliard julliard at winehq.org
Tue Jun 8 10:08:24 CDT 2010


Module: wine
Branch: master
Commit: a2791a0919d27bf49f783595f78eff06e8223468
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a2791a0919d27bf49f783595f78eff06e8223468

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jun  8 15:34:59 2010 +0200

oleaut32: Fix handling of 'c' format for non-date variants in VarTokenizeFormatString.

---

 dlls/oleaut32/tests/varformat.c |    1 +
 dlls/oleaut32/varformat.c       |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/oleaut32/tests/varformat.c b/dlls/oleaut32/tests/varformat.c
index fd598cb..2d4ef62 100644
--- a/dlls/oleaut32/tests/varformat.c
+++ b/dlls/oleaut32/tests/varformat.c
@@ -328,6 +328,7 @@ static void test_VarFormat(void)
   VARFMT(VT_I4,V_I4,1,"000###",S_OK,"000001");
   VARFMT(VT_I4,V_I4,1,"#00##00#0",S_OK,"00000001");
   VARFMT(VT_I4,V_I4,1,"1#####0000",S_OK,"10001");
+  VARFMT(VT_I4,V_I4,1,"##abcdefghijklmnopqrstuvwxyz",S_OK,"1abcdefghijklmnopqrstuvwxyz");
   VARFMT(VT_I4,V_I4,100000,"#,###,###,###",S_OK,"100,000");
   VARFMT(VT_I4,V_I4,1,"0,000,000,000",S_OK,"0,000,000,001");
   VARFMT(VT_I4,V_I4,123456789,"#,#.#",S_OK,"123,456,789.");
diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c
index 10f5038..f297641 100644
--- a/dlls/oleaut32/varformat.c
+++ b/dlls/oleaut32/varformat.c
@@ -852,7 +852,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
       *pOut++ = FMT_DATE_AMPM_UPPER;
       TRACE("AM/PM\n");
     }
-    else if (*pFormat == 'c' || *pFormat == 'C')
+    else if ((*pFormat == 'c' || *pFormat == 'C') && COULD_BE(FMT_TYPE_DATE))
     {
       /* Date formats: General date format
        * Other formats: Literal




More information about the wine-cvs mailing list