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
7ee2c24a
Commit
7ee2c24a
authored
Nov 06, 2013
by
Sebastian Lackner
Committed by
Alexandre Julliard
Nov 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Fix UrlCombineW for URLs containing a quotation mark.
parent
15543701
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
url.c
dlls/shlwapi/tests/url.c
+2
-0
url.c
dlls/shlwapi/url.c
+9
-6
No files found.
dlls/shlwapi/tests/url.c
View file @
7ee2c24a
...
...
@@ -327,6 +327,8 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
{
"http://www.winehq.org/test12"
,
"#"
,
0
,
S_OK
,
"http://www.winehq.org/test12#"
},
{
"http://www.winehq.org/test13#aaa"
,
"#bbb"
,
0
,
S_OK
,
"http://www.winehq.org/test13#bbb"
},
{
"http://www.winehq.org/test14#aaa/bbb#ccc"
,
"#"
,
0
,
S_OK
,
"http://www.winehq.org/test14#"
},
{
"http://www.winehq.org/tests/?query=x/y/z"
,
"tests15"
,
0
,
S_OK
,
"http://www.winehq.org/tests/tests15"
},
{
"http://www.winehq.org/tests/?query=x/y/z#example"
,
"tests16"
,
0
,
S_OK
,
"http://www.winehq.org/tests/tests16"
},
{
"file:///C:
\\
dir
\\
file.txt"
,
"test.txt"
,
0
,
S_OK
,
"file:///C:/dir/test.txt"
},
{
"file:///C:
\\
dir
\\
file.txt#hash
\\
hash"
,
"test.txt"
,
0
,
S_OK
,
"file:///C:/dir/file.txt#hash/test.txt"
},
{
"file:///C:
\\
dir
\\
file.html#hash
\\
hash"
,
"test.html"
,
0
,
S_OK
,
"file:///C:/dir/test.html"
},
...
...
dlls/shlwapi/url.c
View file @
7ee2c24a
...
...
@@ -665,6 +665,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
DWORD
i
,
len
,
res1
,
res2
,
process_case
=
0
;
LPWSTR
work
,
preliminary
,
mbase
,
mrelative
;
static
const
WCHAR
myfilestr
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
,
'\0'
};
static
const
WCHAR
fragquerystr
[]
=
{
'#'
,
'?'
,
0
};
HRESULT
ret
;
TRACE
(
"(base %s, Relative %s, Combine size %d, flags %08x)
\n
"
,
...
...
@@ -736,17 +737,19 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
}
}
/* If there is a '#' and the characters immediately preceding it are
* ".htm[l]", then begin looking for the last leaf starting from
* the '#'. Otherwise the '#' is not meaningful and just start
* looking from the end. */
if
((
work
=
strchrW
(
base
.
pszSuffix
+
sizeloc
,
'#'
)))
{
/* If there is a '?', then the remaining part can only contain a
* query string or fragment, so start looking for the last leaf
* from the '?'. Otherwise, if there is a '#' and the characters
* immediately preceding it are ".htm[l]", then begin looking for
* the last leaf starting from the '#'. Otherwise the '#' is not
* meaningful and just start looking from the end. */
if
((
work
=
strpbrkW
(
base
.
pszSuffix
+
sizeloc
,
fragquerystr
)))
{
const
WCHAR
htmlW
[]
=
{
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
const
int
len_htmlW
=
5
;
const
WCHAR
htmW
[]
=
{
'.'
,
'h'
,
't'
,
'm'
,
0
};
const
int
len_htmW
=
4
;
if
(
base
.
nScheme
==
URL_SCHEME_HTTP
||
base
.
nScheme
==
URL_SCHEME_HTTPS
)
if
(
*
work
==
'?'
||
base
.
nScheme
==
URL_SCHEME_HTTP
||
base
.
nScheme
==
URL_SCHEME_HTTPS
)
manual_search
=
TRUE
;
else
if
(
work
-
base
.
pszSuffix
>
len_htmW
)
{
work
-=
len_htmW
;
...
...
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