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
386cb659
Commit
386cb659
authored
Feb 26, 2010
by
Andrew Eikum
Committed by
Alexandre Julliard
Mar 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Ignore the hash of HTML URLs in UrlCombine.
parent
ef4a9cad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
+46
-7
url.c
dlls/shlwapi/tests/url.c
+5
-0
url.c
dlls/shlwapi/url.c
+41
-7
No files found.
dlls/shlwapi/tests/url.c
View file @
386cb659
...
@@ -278,6 +278,11 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
...
@@ -278,6 +278,11 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
{
"http://www.winehq.org/tests/../tests/"
,
"/tests10/.."
,
URL_DONT_SIMPLIFY
,
S_OK
,
"http://www.winehq.org/tests10/.."
},
{
"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/tests/../"
,
"tests11"
,
URL_DONT_SIMPLIFY
,
S_OK
,
"http://www.winehq.org/tests/../tests11"
},
{
"file:///C:
\\
dir
\\
file.txt"
,
"test.txt"
,
0
,
S_OK
,
"file:///C:/dir/test.txt"
},
{
"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"
},
{
"file:///C:
\\
dir
\\
file.htm#hash
\\
hash"
,
"test.htm"
,
0
,
S_OK
,
"file:///C:/dir/test.htm"
},
{
"file:///C:
\\
dir
\\
file.hTmL#hash
\\
hash"
,
"test.hTmL"
,
0
,
S_OK
,
"file:///C:/dir/test.hTmL"
},
{
"file:///C:
\\
dir.html
\\
file.txt#hash
\\
hash"
,
"test.txt"
,
0
,
S_OK
,
"file:///C:/dir.html/file.txt#hash/test.txt"
},
{
"C:
\\
winehq
\\
winehq.txt"
,
"C:
\\
Test
\\
test.txt"
,
0
,
S_OK
,
"file:///C:/Test/test.txt"
},
{
"C:
\\
winehq
\\
winehq.txt"
,
"C:
\\
Test
\\
test.txt"
,
0
,
S_OK
,
"file:///C:/Test/test.txt"
},
{
"http://www.winehq.org/test/"
,
"test%20file.txt"
,
0
,
S_OK
,
"http://www.winehq.org/test/test%20file.txt"
},
{
"http://www.winehq.org/test/"
,
"test%20file.txt"
,
0
,
S_OK
,
"http://www.winehq.org/test/test%20file.txt"
},
{
"http://www.winehq.org/test/"
,
"test%20file.txt"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"http://www.winehq.org/test/test%20file.txt"
},
{
"http://www.winehq.org/test/"
,
"test%20file.txt"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"http://www.winehq.org/test/test%20file.txt"
},
...
...
dlls/shlwapi/url.c
View file @
386cb659
...
@@ -630,6 +630,8 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
...
@@ -630,6 +630,8 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
process_case
=
1
;
process_case
=
1
;
}
}
else
do
{
else
do
{
BOOL
manual_search
=
FALSE
;
/* mk is a special case */
/* mk is a special case */
if
(
base
.
nScheme
==
URL_SCHEME_MK
)
{
if
(
base
.
nScheme
==
URL_SCHEME_MK
)
{
static
const
WCHAR
wsz
[]
=
{
':'
,
':'
,
0
};
static
const
WCHAR
wsz
[]
=
{
':'
,
':'
,
0
};
...
@@ -659,13 +661,45 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
...
@@ -659,13 +661,45 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
}
}
}
}
/* Change .sizep2 to not have the last leaf in it,
/* If there is a '#' and the characters immediately preceeding it are
* Note: we need to start after the location (if it exists)
* ".htm[l]", then begin looking for the last leaf starting from
*/
* the '#'. Otherwise the '#' is not meaningful and just start
work
=
strrchrW
((
base
.
pszSuffix
+
sizeloc
),
'/'
);
* looking from the end. */
if
(
work
)
{
if
((
work
=
strchrW
(
base
.
pszSuffix
+
sizeloc
,
'#'
)))
{
len
=
(
DWORD
)(
work
-
base
.
pszSuffix
+
1
);
const
WCHAR
htmlW
[]
=
{
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
base
.
cchSuffix
=
len
;
const
int
len_htmlW
=
5
;
const
WCHAR
htmW
[]
=
{
'.'
,
'h'
,
't'
,
'm'
,
0
};
const
int
len_htmW
=
4
;
if
(
work
-
base
.
pszSuffix
>
len_htmW
*
sizeof
(
WCHAR
))
{
work
-=
len_htmW
;
if
(
strncmpiW
(
work
,
htmW
,
len_htmW
)
==
0
)
manual_search
=
TRUE
;
work
+=
len_htmW
;
}
if
(
!
manual_search
&&
work
-
base
.
pszSuffix
>
len_htmlW
*
sizeof
(
WCHAR
))
{
work
-=
len_htmlW
;
if
(
strncmpiW
(
work
,
htmlW
,
len_htmlW
)
==
0
)
manual_search
=
TRUE
;
work
+=
len_htmlW
;
}
}
if
(
manual_search
)
{
/* 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
;
}
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
;
}
}
}
/*
/*
...
...
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