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
5024a057
Commit
5024a057
authored
Nov 07, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Improved UrlCombineW implementation.
parent
872ba8af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
url.c
dlls/shlwapi/tests/url.c
+3
-0
url.c
dlls/shlwapi/url.c
+15
-4
No files found.
dlls/shlwapi/tests/url.c
View file @
5024a057
...
...
@@ -313,6 +313,9 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
{
"http://www.winehq.org/tests/#example"
,
"tests9"
,
0
,
S_OK
,
"http://www.winehq.org/tests/tests9"
},
{
"http://www.winehq.org/tests/../tests/"
,
"/tests10/.."
,
URL_DONT_SIMPLIFY
,
S_OK
,
"http://www.winehq.org/tests10/.."
},
{
"http://www.winehq.org/tests/../"
,
"tests11"
,
URL_DONT_SIMPLIFY
,
S_OK
,
"http://www.winehq.org/tests/../tests11"
},
{
"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#"
},
{
"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 @
5024a057
...
...
@@ -730,7 +730,9 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
const
WCHAR
htmW
[]
=
{
'.'
,
'h'
,
't'
,
'm'
,
0
};
const
int
len_htmW
=
4
;
if
(
work
-
base
.
pszSuffix
>
len_htmW
*
sizeof
(
WCHAR
))
{
if
(
base
.
nScheme
==
URL_SCHEME_HTTP
||
base
.
nScheme
==
URL_SCHEME_HTTPS
)
manual_search
=
TRUE
;
else
if
(
work
-
base
.
pszSuffix
>
len_htmW
*
sizeof
(
WCHAR
))
{
work
-=
len_htmW
;
if
(
strncmpiW
(
work
,
htmW
,
len_htmW
)
==
0
)
manual_search
=
TRUE
;
...
...
@@ -750,15 +752,15 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
/* search backwards starting from the current position */
while
(
*
work
!=
'/'
&&
work
>
base
.
pszSuffix
+
sizeloc
)
--
work
;
if
(
work
>
base
.
pszSuffix
+
sizeloc
)
base
.
cchSuffix
=
work
-
base
.
pszSuffix
+
1
;
base
.
cchSuffix
=
work
-
base
.
pszSuffix
+
1
;
}
else
{
/* search backwards starting from the end of the string */
work
=
strrchrW
((
base
.
pszSuffix
+
sizeloc
),
'/'
);
if
(
work
)
{
len
=
(
DWORD
)(
work
-
base
.
pszSuffix
+
1
);
base
.
cchSuffix
=
len
;
}
}
else
base
.
cchSuffix
=
sizeloc
;
}
/*
...
...
@@ -801,6 +803,15 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
process_case
=
4
;
break
;
}
if
(
*
mrelative
==
'#'
)
{
if
(
!
(
work
=
strchrW
(
base
.
pszSuffix
+
base
.
cchSuffix
,
'#'
)))
work
=
(
LPWSTR
)
base
.
pszSuffix
+
strlenW
(
base
.
pszSuffix
);
memcpy
(
preliminary
,
base
.
pszProtocol
,
(
work
-
base
.
pszProtocol
)
*
sizeof
(
WCHAR
));
preliminary
[
work
-
base
.
pszProtocol
]
=
'\0'
;
process_case
=
1
;
break
;
}
process_case
=
(
*
base
.
pszSuffix
==
'/'
||
base
.
nScheme
==
URL_SCHEME_MK
)
?
5
:
3
;
break
;
}
...
...
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