Hans Leidekker : msi: Unescape ^Q^Y sequences in text archives.

Alexandre Julliard julliard at winehq.org
Thu May 12 13:57:53 CDT 2011


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu May 12 17:24:11 2011 +0200

msi: Unescape ^Q^Y sequences in text archives.

---

 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 );




More information about the wine-cvs mailing list