oleaut32: Fix localized date parsing.
authorAndré Hentschel <nerv@dawncrow.de>
Wed, 3 Mar 2010 18:57:27 +0000 (19:57 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 4 Mar 2010 11:28:28 +0000 (12:28 +0100)
dlls/oleaut32/tests/vartype.c
dlls/oleaut32/vartype.c

index 0c23a1143d83d9a1208764ffa9f68e4fc0bd061b..6742fce2168686ed809522d8c69887fbf80d29f5 100644 (file)
@@ -3435,10 +3435,10 @@ static void test_VarDateFromStr(void)
   DFS("1-2-1970");        EXPECT_DBL(25570.0);
   /* Native fails "1999 January 3, 9AM". I consider that a bug in native */
 
-  /* test a nonenglish data string */
+  /* test a non-english data string */
   DFS("02.01.1970 00:00:00"); EXPECT_MISMATCH;
   lcid = MAKELCID(MAKELANGID(LANG_GERMAN,SUBLANG_GERMAN),SORT_DEFAULT);
-  DFS("02.01.1970"); todo_wine EXPECT_DBL(25570.0);
+  DFS("02.01.1970"); EXPECT_DBL(25570.0);
   DFS("02.01.1970 00:00:00"); todo_wine EXPECT_DBL(25570.0);
 }
 
index 6d604f3d0c23f1418109333d5332d66beb883c0c..580209b75392f9b8751654692e855823183690fd 100644 (file)
@@ -7607,6 +7607,14 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
       break;
 
     case 0x3: /* TTT TTTDD TTTDDD */
+      if (iDate && dp.dwCount == 3)
+        {
+          /* DDD */
+          if ((dp.dwFlags[0] & (DP_AM|DP_PM)) || (dp.dwFlags[1] & (DP_AM|DP_PM)) ||
+              (dp.dwFlags[2] & (DP_AM|DP_PM)))
+            hRet = DISP_E_TYPEMISMATCH;
+          break;
+        }
       if (dp.dwCount > 4 &&
           ((dp.dwFlags[3] & (DP_AM|DP_PM)) || (dp.dwFlags[4] & (DP_AM|DP_PM)) ||
           (dp.dwFlags[5] & (DP_AM|DP_PM))))