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
9339be64
Commit
9339be64
authored
Jun 02, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Jun 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Simplify UrlCombine case 2 with tests.
parent
c18d69ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
22 deletions
+23
-22
url.c
dlls/shlwapi/tests/url.c
+22
-1
url.c
dlls/shlwapi/url.c
+1
-21
No files found.
dlls/shlwapi/tests/url.c
View file @
9339be64
...
...
@@ -263,7 +263,28 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
{
"foo:/today"
,
"foo:calendar"
,
0
,
S_OK
,
"foo:/calendar"
},
{
"foo:/today/"
,
"foo:calendar"
,
0
,
S_OK
,
"foo:/today/calendar"
},
{
"mk:@MSITStore:dir/test.chm::dir/index.html"
,
"image.jpg"
,
0
,
S_OK
,
"mk:@MSITStore:dir/test.chm::dir/image.jpg"
},
{
"mk:@MSITStore:dir/test.chm::dir/dir2/index.html"
,
"../image.jpg"
,
0
,
S_OK
,
"mk:@MSITStore:dir/test.chm::dir/image.jpg"
}
{
"mk:@MSITStore:dir/test.chm::dir/dir2/index.html"
,
"../image.jpg"
,
0
,
S_OK
,
"mk:@MSITStore:dir/test.chm::dir/image.jpg"
},
/* UrlCombine case 2 tests. Schemes do not match */
{
"outbind://xxxxxxxxx"
,
"http://wine1/dir"
,
0
,
S_OK
,
"http://wine1/dir"
},
{
"xxxx://xxxxxxxxx"
,
"http://wine2/dir"
,
0
,
S_OK
,
"http://wine2/dir"
},
{
"ftp://xxxxxxxxx/"
,
"http://wine3/dir"
,
0
,
S_OK
,
"http://wine3/dir"
},
{
"outbind://xxxxxxxxx"
,
"http://wine4/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"http://wine4/dir"
},
{
"xxx://xxxxxxxxx"
,
"http://wine5/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"http://wine5/dir"
},
{
"ftp://xxxxxxxxx/"
,
"http://wine6/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"http://wine6/dir"
},
{
"http://xxxxxxxxx"
,
"outbind://wine7/dir"
,
0
,
S_OK
,
"outbind://wine7/dir"
},
{
"xxx://xxxxxxxxx"
,
"ftp://wine8/dir"
,
0
,
S_OK
,
"ftp://wine8/dir"
},
{
"ftp://xxxxxxxxx/"
,
"xxx://wine9/dir"
,
0
,
S_OK
,
"xxx://wine9/dir"
},
{
"http://xxxxxxxxx"
,
"outbind://wine10/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"outbind://wine10/dir"
},
{
"xxx://xxxxxxxxx"
,
"ftp://wine11/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"ftp://wine11/dir"
},
{
"ftp://xxxxxxxxx/"
,
"xxx://wine12/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"xxx://wine12/dir"
},
{
"http://xxxxxxxxx"
,
"outbind:wine13/dir"
,
0
,
S_OK
,
"outbind:wine13/dir"
},
{
"xxx://xxxxxxxxx"
,
"ftp:wine14/dir"
,
0
,
S_OK
,
"ftp:wine14/dir"
},
{
"ftp://xxxxxxxxx/"
,
"xxx:wine15/dir"
,
0
,
S_OK
,
"xxx:wine15/dir"
},
{
"outbind://xxxxxxxxx/"
,
"http:wine16/dir"
,
0
,
S_OK
,
"http:wine16/dir"
},
{
"http://xxxxxxxxx"
,
"outbind:wine17/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"outbind:wine17/dir"
},
{
"xxx://xxxxxxxxx"
,
"ftp:wine18/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"ftp:wine18/dir"
},
{
"ftp://xxxxxxxxx/"
,
"xxx:wine19/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"xxx:wine19/dir"
},
{
"outbind://xxxxxxxxx/"
,
"http:wine20/dir"
,
URL_PLUGGABLE_PROTOCOL
,
S_OK
,
"http:wine20/dir"
}
};
/* ################ */
...
...
dlls/shlwapi/url.c
View file @
9339be64
...
...
@@ -129,19 +129,6 @@ static DWORD get_scheme_code(LPCWSTR scheme, DWORD scheme_len)
return
URL_SCHEME_UNKNOWN
;
}
static
BOOL
URL_JustLocation
(
LPCWSTR
str
)
{
while
(
*
str
&&
(
*
str
==
'/'
))
str
++
;
if
(
*
str
)
{
while
(
*
str
&&
((
*
str
==
'-'
)
||
(
*
str
==
'.'
)
||
isalnumW
(
*
str
)))
str
++
;
if
(
*
str
==
'/'
)
return
FALSE
;
}
return
TRUE
;
}
/*************************************************************************
* @ [SHLWAPI.1]
*
...
...
@@ -608,7 +595,6 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
DWORD
len
,
res1
,
res2
,
process_case
=
0
;
LPWSTR
work
,
preliminary
,
mbase
,
mrelative
;
static
const
WCHAR
myfilestr
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
,
'\0'
};
static
const
WCHAR
single_slash
[]
=
{
'/'
,
'\0'
};
HRESULT
ret
;
TRACE
(
"(base %s, Relative %s, Combine size %d, flags %08x)
\n
"
,
...
...
@@ -768,14 +754,8 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
strcatW
(
preliminary
,
mrelative
);
break
;
case
2
:
/*
* Same as case 1, but if URL_PLUGGABLE_PROTOCOL was specified
* and pszRelative starts with "//", then append a "/"
*/
case
2
:
/* case where pszRelative replaces scheme, and location */
strcpyW
(
preliminary
,
mrelative
);
if
(
!
(
dwFlags
&
URL_PLUGGABLE_PROTOCOL
)
&&
URL_JustLocation
(
relative
.
pszSuffix
))
strcatW
(
preliminary
,
single_slash
);
break
;
case
3
:
/*
...
...
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