[4/4] msi: Unescape ^Q^Y sequences in text archives.

Hans Leidekker hans at codeweavers.com
Thu May 12 10:24:11 CDT 2011


Should fix http://bugs.winehq.org/show_bug.cgi?id=27130
---
 dlls/msi/database.c |    5 +++++
 dlls/msi/tests/db.c |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index e7164e5..9b5a894 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -575,6 +575,11 @@ static void msi_parse_line(LPWSTR *line, LPWSTR **entries, DWORD *num_entries, D
         while (chars_left && *ptr != '\t' && *ptr != '\n' && *ptr != '\r')
         {
             if (!*ptr) *ptr = '\n'; /* convert embedded nulls to \n */
+            if (ptr > *line && *ptr == '\x19' && *(ptr - 1) == '\x11')
+            {
+                *ptr = '\n';
+                *(ptr - 1) = '\r';
+            }
             ptr++;
             chars_left--;
         }
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 08b84bf..a9d0e933 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -9259,7 +9259,7 @@ static void test_embedded_nulls(void)
         "Dialog\tText\n"
         "s72\tL0\n"
         "Control\tDialog\n"
-        "LicenseAgreementDlg\ttext\0text";
+        "LicenseAgreementDlg\ttext\x11\x19text\0text";
     UINT r, sz;
     MSIHANDLE hdb, hrec;
     char buffer[32];
@@ -9280,7 +9280,7 @@ static void test_embedded_nulls(void)
     sz = sizeof(buffer);
     r = MsiRecordGetStringA( hrec, 1, buffer, &sz );
     ok( r == ERROR_SUCCESS, "failed to get string %u\n", r );
-    ok( !memcmp( "text\ntext", buffer, sizeof("text\ntext") - 1 ), "wrong buffer contents \"%s\"\n", buffer );
+    ok( !memcmp( "text\r\ntext\ntext", buffer, sizeof("text\r\ntext\ntext") - 1 ), "wrong buffer contents \"%s\"\n", buffer );
 
     MsiCloseHandle( hrec );
     MsiCloseHandle( hdb );
-- 
1.7.4.1






More information about the wine-patches mailing list