Hib Eris : msi: Fix merging string type checks.
Alexandre Julliard
julliard at winehq.org
Tue Oct 20 10:33:41 CDT 2009
Module: wine
Branch: master
Commit: 9dddb94b9990e3919f0b879934229de57e75f2a6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9dddb94b9990e3919f0b879934229de57e75f2a6
Author: Hib Eris <hib at hiberis.nl>
Date: Tue Oct 20 15:49:39 2009 +0200
msi: Fix merging string type checks.
---
dlls/msi/database.c | 15 ++++++++++++++-
dlls/msi/tests/db.c | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index 85d71c2..adbdb9d 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -1081,6 +1081,19 @@ typedef struct _tagMERGEDATA
struct list *tabledata;
} MERGEDATA;
+static BOOL merge_type_match(LPCWSTR type1, LPCWSTR type2)
+{
+ if (((type1[0] == 'l') || (type1[0] == 's')) &&
+ ((type2[0] == 'l') || (type2[0] == 's')))
+ return TRUE;
+
+ if (((type1[0] == 'L') || (type1[0] == 'S')) &&
+ ((type2[0] == 'L') || (type2[0] == 'S')))
+ return TRUE;
+
+ return !lstrcmpW(type1, type2);
+}
+
static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview)
{
MSIRECORD *dbrec, *mergerec;
@@ -1126,7 +1139,7 @@ static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview)
if (!MSI_RecordGetString(mergerec, i))
break;
- if (lstrcmpW(MSI_RecordGetString(dbrec, i),
+ if (!merge_type_match(MSI_RecordGetString(dbrec, i),
MSI_RecordGetString(mergerec, i)))
{
r = ERROR_DATATYPE_MISMATCH;
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 7013fa4..4bb0039 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -7273,7 +7273,7 @@ static void test_dbmerge(void)
/* column sting types don't match exactly */
r = MsiDatabaseMergeA(hdb, href, "MergeErrors");
- todo_wine ok(r == ERROR_SUCCESS,
+ ok(r == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", r);
/* nothing in MergeErrors */
More information about the wine-cvs
mailing list