Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
60e4f8a2
Commit
60e4f8a2
authored
Jun 21, 2023
by
David Kahurani
Committed by
Alexandre Julliard
Jun 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Convert newlines to alternate representation when exporting.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54532
Signed-off-by:
David Kahurani
<
k.kahurani@gmail.com
>
parent
e1ddc58a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
database.c
dlls/msi/database.c
+17
-1
db.c
dlls/msi/tests/db.c
+12
-0
No files found.
dlls/msi/database.c
View file @
60e4f8a2
...
...
@@ -892,7 +892,7 @@ end:
static
UINT
export_field
(
HANDLE
handle
,
MSIRECORD
*
row
,
UINT
field
)
{
char
*
buffer
;
char
*
buffer
,
*
ptr
;
BOOL
ret
;
DWORD
sz
=
0x100
;
UINT
r
;
...
...
@@ -928,6 +928,22 @@ static UINT export_field( HANDLE handle, MSIRECORD *row, UINT field )
return
r
;
}
ptr
=
buffer
;
while
(
*
ptr
)
{
if
(
*
ptr
==
'\r'
&&
*
(
ptr
+
1
)
==
'\n'
)
{
*
ptr
++
=
'\x11'
;
*
ptr
++
=
'\x19'
;
continue
;
}
if
(
*
ptr
==
'\n'
)
*
ptr
=
'\x19'
;
ptr
++
;
}
ret
=
WriteFile
(
handle
,
buffer
,
sz
,
&
sz
,
NULL
);
free
(
buffer
);
return
ret
?
ERROR_SUCCESS
:
ERROR_FUNCTION_FAILED
;
...
...
dlls/msi/tests/db.c
View file @
60e4f8a2
...
...
@@ -8584,12 +8584,18 @@ static void test_embedded_nulls(void)
"s72
\t
L0
\n
"
"Control
\t
Dialog
\n
"
"LicenseAgreementDlg
\t
text
\x11\x19
text
\0
text"
;
static
const
char
export_expected
[]
=
"Dialog
\t
Text
\r\n
"
"s72
\t
L0
\r\n
"
"Control
\t
Dialog
\r\n
"
"LicenseAgreementDlg
\t
text
\x11\x19
text
\x19
text"
;
/* newlines have alternate representation in idt files */
static
const
char
control_table2
[]
=
"Dialog
\t
Text
\n
"
"s72
\t
L0
\n
"
"Control
\t
Dialog
\n
"
"LicenseAgreementDlg
\t
text
\x11\x19
te
\n
xt
\0
text"
;
char
data
[
1024
];
UINT
r
;
DWORD
sz
;
MSIHANDLE
hdb
,
hrec
;
...
...
@@ -8613,6 +8619,12 @@ static void test_embedded_nulls(void)
ok
(
r
==
ERROR_SUCCESS
,
"failed to get string %u
\n
"
,
r
);
ok
(
!
memcmp
(
"text
\r\n
text
\n
text"
,
buffer
,
sizeof
(
"text
\r\n
text
\n
text"
)
-
1
),
"wrong buffer contents
\"
%s
\"\n
"
,
buffer
);
r
=
MsiDatabaseExportA
(
hdb
,
"Control"
,
CURR_DIR
,
"temp_file1"
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to export table %u
\n
"
,
r
);
read_file_data
(
"temp_file1"
,
data
);
ok
(
!
memcmp
(
data
,
export_expected
,
sizeof
(
export_expected
)
-
1
),
"expected:
\"
%s
\"
got:
\"
%s
\"\n
"
,
export_expected
,
data
);
DeleteFileA
(
"temp_file1"
);
MsiCloseHandle
(
hrec
);
MsiCloseHandle
(
hdb
);
DeleteFileA
(
msifile
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment