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
fe89d8ac
Commit
fe89d8ac
authored
Aug 25, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Aug 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Finished adding basic support for Uri_CREATE_FILE_USE_DOS_PATH.
parent
94800987
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
10 deletions
+87
-10
uri.c
dlls/urlmon/tests/uri.c
+62
-1
uri.c
dlls/urlmon/uri.c
+25
-9
No files found.
dlls/urlmon/tests/uri.c
View file @
fe89d8ac
...
...
@@ -3887,6 +3887,64 @@ static const uri_properties uri_tests[] = {
{
URL_SCHEME_UNKNOWN
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
/* Dot segements aren't removed. */
{
"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
|
Uri_HAS_SCHEME
,
FALSE
,
{
{
"file://c:
\\
dir
\\
..
\\
..
\\
.
\\
index.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file://c:
\\
dir
\\
..
\\
..
\\
.
\\
index.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
".html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"c:
\\
dir
\\
..
\\
..
\\
.
\\
index.html"
,
S_OK
,
FALSE
},
{
"c:
\\
dir
\\
..
\\
..
\\
.
\\
index.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file://c:
\\
dir
\\
../..
\\
./index.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
}
}
},
/* Forbidden characters aren't percent encoded. */
{
"file://c:
\\
dir
\\
i^|ndex.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
\\
i^|ndex.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file://c:
\\
dir
\\
i^|ndex.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
".html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"c:
\\
dir
\\
i^|ndex.html"
,
S_OK
,
FALSE
},
{
"c:
\\
dir
\\
i^|ndex.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"file://c:
\\
dir
\\
i^|ndex.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
}
}
}
};
...
...
@@ -3945,7 +4003,10 @@ static const invalid_uri invalid_uri_tests[] = {
/* Invalid % encoded data in fragment of know scheme type. */
{
"ftp://google.com/#Test%xx"
,
0
,
FALSE
},
{
" http://google.com/"
,
Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,
FALSE
},
{
"
\n\n
http://google.com/"
,
Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,
FALSE
}
{
"
\n\n
http://google.com/"
,
Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,
FALSE
},
{
"file://c:
\\
test<test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
FALSE
},
{
"file://c:
\\
test>test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
FALSE
},
{
"file://c:
\\
test
\"
test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
FALSE
}
};
typedef
struct
_uri_equality
{
...
...
dlls/urlmon/uri.c
View file @
fe89d8ac
...
...
@@ -1776,6 +1776,7 @@ static BOOL parse_authority(const WCHAR **ptr, parse_data *data, DWORD flags) {
static
BOOL
parse_path_hierarchical
(
const
WCHAR
**
ptr
,
parse_data
*
data
,
DWORD
flags
)
{
const
WCHAR
*
start
=
*
ptr
;
static
const
WCHAR
slash
[]
=
{
'/'
,
0
};
const
BOOL
is_file
=
data
->
scheme_type
==
URL_SCHEME_FILE
;
if
(
is_path_delim
(
**
ptr
))
{
if
(
data
->
scheme_type
==
URL_SCHEME_WILDCARD
)
{
...
...
@@ -1791,13 +1792,19 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f
}
}
else
{
while
(
!
is_path_delim
(
**
ptr
))
{
if
(
**
ptr
==
'%'
&&
data
->
scheme_type
!=
URL_SCHEME_UNKNOWN
&&
data
->
scheme_type
!=
URL_SCHEME_FILE
)
{
if
(
**
ptr
==
'%'
&&
data
->
scheme_type
!=
URL_SCHEME_UNKNOWN
&&
!
is_file
)
{
if
(
!
check_pct_encoded
(
ptr
))
{
*
ptr
=
start
;
return
FALSE
;
}
else
continue
;
}
else
if
((
**
ptr
==
'>'
||
**
ptr
==
'<'
||
**
ptr
==
'\"'
)
&&
is_file
&&
(
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
))
{
/* File schemes with USE_DOS_PATH set aren't allowed to have
* a '<' or '>' or '\"' appear in them.
*/
*
ptr
=
start
;
return
FALSE
;
}
else
if
(
**
ptr
==
'\\'
)
{
/* Not allowed to have a backslash if NO_CANONICALIZE is set
* and the scheme is known type (but not a file scheme).
...
...
@@ -2742,10 +2749,17 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri,
}
}
else
if
(
known_scheme
&&
!
is_unreserved
(
*
ptr
)
&&
!
is_reserved
(
*
ptr
)
&&
(
!
(
flags
&
Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
)
||
is_file
))
{
/* Escape the forbidden character. */
if
(
!
computeOnly
)
pct_encode_val
(
*
ptr
,
uri
->
canon_uri
+
uri
->
canon_len
);
uri
->
canon_len
+=
3
;
if
(
is_file
&&
(
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
))
{
/* Don't escape the character. */
if
(
!
computeOnly
)
uri
->
canon_uri
[
uri
->
canon_len
]
=
*
ptr
;
++
uri
->
canon_len
;
}
else
{
/* Escape the forbidden character. */
if
(
!
computeOnly
)
pct_encode_val
(
*
ptr
,
uri
->
canon_uri
+
uri
->
canon_len
);
uri
->
canon_len
+=
3
;
}
}
else
{
if
(
!
computeOnly
)
uri
->
canon_uri
[
uri
->
canon_len
]
=
*
ptr
;
...
...
@@ -2756,10 +2770,12 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri,
uri
->
path_len
=
uri
->
canon_len
-
uri
->
path_start
;
/* Removing the dot segments only happens when it's not in
* computeOnly mode and it's not a wildcard scheme.
* computeOnly mode and it's not a wildcard scheme. File schemes
* with USE_DOS_PATH set don't get dot segments removed.
*/
if
(
!
computeOnly
&&
data
->
scheme_type
!=
URL_SCHEME_WILDCARD
)
{
if
(
!
(
flags
&
Uri_CREATE_NO_CANONICALIZE
))
{
if
(
!
(
is_file
&&
(
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
))
&&
data
->
scheme_type
!=
URL_SCHEME_WILDCARD
)
{
if
(
!
(
flags
&
Uri_CREATE_NO_CANONICALIZE
)
&&
!
computeOnly
)
{
/* Remove the dot segments (if any) and reset everything to the new
* correct length.
*/
...
...
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