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
8a6210d2
Commit
8a6210d2
authored
Oct 26, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Improved url canonicalize when Uri_CREATE_FILE_USE_DOS_PATH is specified.
parent
92f41c56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
uri.c
dlls/urlmon/tests/uri.c
+29
-0
uri.c
dlls/urlmon/uri.c
+4
-2
No files found.
dlls/urlmon/tests/uri.c
View file @
8a6210d2
...
...
@@ -3744,6 +3744,35 @@ static const uri_properties uri_tests[] = {
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
/* Allow more characters when Uri_CREATE_FILE_USE_DOS_PATH is specified */
{
"file:///c:/dir\%%61%20%5Fname/file%2A.html"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
S_OK
,
FALSE
,
Uri_HAS_ABSOLUTE_URI
|
Uri_HAS_DISPLAY_URI
|
Uri_HAS_EXTENSION
|
Uri_HAS_PATH
|
Uri_HAS_PATH_AND_QUERY
|
Uri_HAS_RAW_URI
|
Uri_HAS_SCHEME_NAME
|
Uri_HAS_HOST_TYPE
|
Uri_HAS_SCHEME
,
FALSE
,
{
{
"file://c:
\\
dir\%a _name
\\
file*.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file://c:
\\
dir\%a _name
\\
file*.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
".html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"c:
\\
dir\%a _name
\\
file*.html"
,
S_OK
,
FALSE
},
{
"c:
\\
dir\%a _name
\\
file*.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file:///c:/dir\%%61%20%5Fname/file%2A.html"
,
S_OK
,
FALSE
},
{
"file"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
0
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_FILE
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"file://c|/dir
\\
index.html"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
S_OK
,
FALSE
,
Uri_HAS_ABSOLUTE_URI
|
Uri_HAS_DISPLAY_URI
|
Uri_HAS_EXTENSION
|
Uri_HAS_PATH
|
Uri_HAS_PATH_AND_QUERY
|
Uri_HAS_RAW_URI
|
Uri_HAS_SCHEME_NAME
|
Uri_HAS_HOST_TYPE
...
...
dlls/urlmon/uri.c
View file @
8a6210d2
...
...
@@ -2870,6 +2870,7 @@ static BOOL canonicalize_authority(const parse_data *data, Uri *uri, DWORD flags
* NOTES:
* file://c:/test%20test -> file:///c:/test%2520test
* file://c:/test%3Etest -> file:///c:/test%253Etest
* if Uri_CREATE_FILE_USE_DOS_PATH is not set:
* file:///c:/test%20test -> file:///c:/test%20test
* file:///c:/test%test -> file:///c:/test%25test
*/
...
...
@@ -2931,7 +2932,7 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri,
WCHAR
val
;
/* Check if the % represents a valid encoded char, or if it needs encoded. */
BOOL
force_encode
=
!
check_pct_encoded
(
&
tmp
)
&&
is_file
;
BOOL
force_encode
=
!
check_pct_encoded
(
&
tmp
)
&&
is_file
&&
!
(
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
)
;
val
=
decode_pct_val
(
ptr
);
if
(
force_encode
||
escape_pct
)
{
...
...
@@ -2940,7 +2941,8 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri,
pct_encode_val
(
*
ptr
,
uri
->
canon_uri
+
uri
->
canon_len
);
uri
->
canon_len
+=
3
;
}
else
if
((
is_unreserved
(
val
)
&&
known_scheme
)
||
(
is_file
&&
(
is_unreserved
(
val
)
||
is_reserved
(
val
))))
{
(
is_file
&&
(
is_unreserved
(
val
)
||
is_reserved
(
val
)
||
(
val
&&
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
&&
!
is_forbidden_dos_path_char
(
val
)))))
{
if
(
!
computeOnly
)
uri
->
canon_uri
[
uri
->
canon_len
]
=
val
;
++
uri
->
canon_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