Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1de7771a
Commit
1de7771a
authored
Jul 24, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Don't threat '#' as path delimiter in file URIs.
parent
de9f19df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
5 deletions
+113
-5
uri.c
dlls/urlmon/tests/uri.c
+108
-0
uri.c
dlls/urlmon/uri.c
+5
-5
No files found.
dlls/urlmon/tests/uri.c
View file @
1de7771a
...
...
@@ -385,6 +385,31 @@ static const uri_properties uri_tests[] = {
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"file:///z:/test dir/README.txt#hash part"
,
0
,
S_OK
,
FALSE
,
{
{
"file:///z:/test%20dir/README.txt#hash%20part"
,
S_OK
},
{
""
,
S_FALSE
},
{
"file:///z:/test%20dir/README.txt#hash%20part"
,
S_OK
},
{
""
,
S_FALSE
},
{
".txt#hash%20part"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"/z:/test%20dir/README.txt#hash%20part"
,
S_OK
},
{
"/z:/test%20dir/README.txt#hash%20part"
,
S_OK
},
{
""
,
S_FALSE
},
{
"file:///z:/test dir/README.txt#hash part"
,
S_OK
},
{
"file"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_FILE
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"urn:nothing:should:happen here"
,
0
,
S_OK
,
FALSE
,
{
{
"urn:nothing:should:happen here"
,
S_OK
,
FALSE
},
...
...
@@ -587,6 +612,81 @@ static const uri_properties uri_tests[] = {
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"C:/test/test.mp3#fragment|part"
,
Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
|
Uri_CREATE_FILE_USE_DOS_PATH
|
Uri_CREATE_NO_DECODE_EXTRA_INFO
,
S_OK
,
FALSE
,
{
{
"file://C:
\\
test
\\
test.mp3#fragment|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file://C:
\\
test
\\
test.mp3#fragment|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
".mp3#fragment|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"C:
\\
test
\\
test.mp3#fragment|part"
,
S_OK
,
FALSE
},
{
"C:
\\
test
\\
test.mp3#fragment|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"C:/test/test.mp3#fragment|part"
,
S_OK
,
FALSE
},
{
"file"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_FILE
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"C:/test/test.mp3?query|part"
,
Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
|
Uri_CREATE_FILE_USE_DOS_PATH
|
Uri_CREATE_NO_DECODE_EXTRA_INFO
,
S_OK
,
FALSE
,
{
{
"file://C:
\\
test
\\
test.mp3?query|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file://C:
\\
test
\\
test.mp3?query|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
".mp3"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"C:
\\
test
\\
test.mp3"
,
S_OK
,
FALSE
},
{
"C:
\\
test
\\
test.mp3?query|part"
,
S_OK
,
FALSE
},
{
"?query|part"
,
S_OK
,
FALSE
},
{
"C:/test/test.mp3?query|part"
,
S_OK
,
FALSE
},
{
"file"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_FILE
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"C:/test/test.mp3?query|part#hash|part"
,
Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
|
Uri_CREATE_FILE_USE_DOS_PATH
|
Uri_CREATE_NO_DECODE_EXTRA_INFO
,
S_OK
,
FALSE
,
{
{
"file://C:
\\
test
\\
test.mp3?query|part#hash|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file://C:
\\
test
\\
test.mp3?query|part#hash|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
".mp3"
,
S_OK
,
FALSE
},
{
"#hash|part"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"C:
\\
test
\\
test.mp3"
,
S_OK
,
FALSE
},
{
"C:
\\
test
\\
test.mp3?query|part"
,
S_OK
,
FALSE
},
{
"?query|part"
,
S_OK
,
FALSE
},
{
"C:/test/test.mp3?query|part#hash|part"
,
S_OK
,
FALSE
},
{
"file"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_FILE
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"www.winehq.org/test"
,
Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,
S_OK
,
FALSE
,
{
{
"*:www.winehq.org/test"
,
S_OK
,
FALSE
},
...
...
@@ -11137,6 +11237,14 @@ static const create_urlmon_test_t create_urlmon_tests[] = {
"file:///c:/dir/file.txt"
,
"file:///c:/dir/file.txt"
,
"file:///c:/dir/file.txt"
,
},
{
"c:
\\
dir
\\
file.txt#frag|part"
,
Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
NULL
,
0
,
"file://c:
\\
dir
\\
file.txt#frag|part"
,
"file:///c:/dir/file.txt#frag%7Cpart"
,
"file:///c:/dir/file.txt#frag%7Cpart"
,
"file:///c:/dir/file.txt#frag%7Cpart"
,
}
};
...
...
dlls/urlmon/uri.c
View file @
1de7771a
...
...
@@ -348,8 +348,8 @@ static inline BOOL is_hexdigit(WCHAR val) {
(
val
>=
'0'
&&
val
<=
'9'
));
}
static
inline
BOOL
is_path_delim
(
WCHAR
val
)
{
return
(
!
val
||
val
==
'#'
||
val
==
'?'
);
static
inline
BOOL
is_path_delim
(
URL_SCHEME
scheme
,
WCHAR
val
)
{
return
(
!
val
||
(
val
==
'#'
&&
scheme
!=
URL_SCHEME_FILE
)
||
val
==
'?'
);
}
static
inline
BOOL
is_slash
(
WCHAR
c
)
...
...
@@ -1842,7 +1842,7 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f
static
const
WCHAR
slash
[]
=
{
'/'
,
0
};
const
BOOL
is_file
=
data
->
scheme_type
==
URL_SCHEME_FILE
;
if
(
is_path_delim
(
**
ptr
))
{
if
(
is_path_delim
(
data
->
scheme_type
,
**
ptr
))
{
if
(
data
->
scheme_type
==
URL_SCHEME_WILDCARD
&&
!
data
->
must_have_path
)
{
data
->
path
=
NULL
;
data
->
path_len
=
0
;
...
...
@@ -1852,7 +1852,7 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f
data
->
path_len
=
1
;
}
}
else
{
while
(
!
is_path_delim
(
**
ptr
))
{
while
(
!
is_path_delim
(
data
->
scheme_type
,
**
ptr
))
{
if
(
**
ptr
==
'%'
&&
data
->
scheme_type
!=
URL_SCHEME_UNKNOWN
&&
!
is_file
)
{
if
(
!
check_pct_encoded
(
ptr
))
{
*
ptr
=
start
;
...
...
@@ -1927,7 +1927,7 @@ static BOOL parse_path_opaque(const WCHAR **ptr, parse_data *data, DWORD flags)
else
data
->
path
=
*
ptr
;
while
(
!
is_path_delim
(
**
ptr
))
{
while
(
!
is_path_delim
(
data
->
scheme_type
,
**
ptr
))
{
if
(
**
ptr
==
'%'
&&
known_scheme
)
{
if
(
!
check_pct_encoded
(
ptr
))
{
*
ptr
=
data
->
path
;
...
...
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