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

This commit is contained in:
Hans Leidekker 2011-05-12 17:24:11 +02:00 committed by Alexandre Julliard
parent e2ba5dce06
commit c7e36d8ba8
2 changed files with 7 additions and 2 deletions

View File

@ -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') while (chars_left && *ptr != '\t' && *ptr != '\n' && *ptr != '\r')
{ {
if (!*ptr) *ptr = '\n'; /* convert embedded nulls to \n */ if (!*ptr) *ptr = '\n'; /* convert embedded nulls to \n */
if (ptr > *line && *ptr == '\x19' && *(ptr - 1) == '\x11')
{
*ptr = '\n';
*(ptr - 1) = '\r';
}
ptr++; ptr++;
chars_left--; chars_left--;
} }

View File

@ -9259,7 +9259,7 @@ static void test_embedded_nulls(void)
"Dialog\tText\n" "Dialog\tText\n"
"s72\tL0\n" "s72\tL0\n"
"Control\tDialog\n" "Control\tDialog\n"
"LicenseAgreementDlg\ttext\0text"; "LicenseAgreementDlg\ttext\x11\x19text\0text";
UINT r, sz; UINT r, sz;
MSIHANDLE hdb, hrec; MSIHANDLE hdb, hrec;
char buffer[32]; char buffer[32];
@ -9280,7 +9280,7 @@ static void test_embedded_nulls(void)
sz = sizeof(buffer); sz = sizeof(buffer);
r = MsiRecordGetStringA( hrec, 1, buffer, &sz ); r = MsiRecordGetStringA( hrec, 1, buffer, &sz );
ok( r == ERROR_SUCCESS, "failed to get string %u\n", r ); 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( hrec );
MsiCloseHandle( hdb ); MsiCloseHandle( hdb );