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
5b7fac05
Commit
5b7fac05
authored
Sep 17, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Treat trailing \0 in field values same way as trailing spaces.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43115a74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
parser.c
dlls/setupapi/parser.c
+2
-2
parser.c
dlls/setupapi/tests/parser.c
+5
-2
No files found.
dlls/setupapi/parser.c
View file @
5b7fac05
...
...
@@ -724,7 +724,7 @@ static const WCHAR *value_name_state( struct parser *parser, const WCHAR *pos )
set_state
(
parser
,
EOL_BACKSLASH
);
return
p
;
default:
if
(
!
iswspace
(
*
p
))
token_end
=
p
+
1
;
if
(
*
p
&&
!
iswspace
(
*
p
))
token_end
=
p
+
1
;
else
{
push_token
(
parser
,
p
);
...
...
@@ -838,7 +838,7 @@ static const WCHAR *trailing_spaces_state( struct parser *parser, const WCHAR *p
set_state
(
parser
,
EOL_BACKSLASH
);
return
p
;
}
if
(
!
iswspace
(
*
p
))
break
;
if
(
*
p
&&
!
iswspace
(
*
p
))
break
;
}
pop_state
(
parser
);
return
p
;
...
...
dlls/setupapi/tests/parser.c
View file @
5b7fac05
...
...
@@ -370,6 +370,9 @@ static const struct
{
C
(
"ab
\032
=cd"
),
"ab"
,
{
"ab"
}
},
/* nulls */
{
C
(
"abcd=ef\x0gh"
),
"abcd"
,
{
"ef gh"
}
},
{
C
(
"foo=%bar%
\n
[Strings]
\n
bar=bbb
\0\n
"
),
"foo"
,
{
"bbb"
}
},
{
C
(
"foo=%bar%
\n
[Strings]
\n
bar=bbb
\0\n
"
),
"foo"
,
{
"bbb"
}
},
{
C
(
"foo=%bar%
\n
[Strings]
\n
bar=aaa
\0
bbb
\0\n
"
),
"foo"
,
{
"aaa bbb"
}
},
/* multiple sections with same name */
{
C
(
"[Test2]
\n
ab
\n
[Test]
\n
ee=ff
\n
"
),
"ee"
,
{
"ff"
}
},
/* string substitution */
...
...
@@ -470,12 +473,12 @@ static void test_key_names(void)
ok
(
err
==
0
,
"line %u: bad error %u
\n
"
,
i
,
err
);
if
(
key_names
[
i
].
fields
[
index
])
{
if
(
i
==
49
)
if
(
i
==
52
)
ok
(
!
strcmp
(
field
,
key_names
[
i
].
fields
[
index
]
)
||
!
strcmp
(
field
,
A1200
),
/* Vista, W2K8 */
"line %u: bad field %s/%s
\n
"
,
i
,
field
,
key_names
[
i
].
fields
[
index
]
);
else
if
(
i
==
5
2
)
else
if
(
i
==
5
5
)
ok
(
!
strcmp
(
field
,
key_names
[
i
].
fields
[
index
]
)
||
!
strcmp
(
field
,
A4096
),
/* Win10 >= 1709 */
"line %u: bad field %s/%s
\n
"
,
...
...
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