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
d3047aae
Commit
d3047aae
authored
Mar 09, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: If necessary, add a slash between the hostname and path in
InternetCreateUrlW.
parent
8eab78c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
internet.c
dlls/wininet/internet.c
+11
-0
http.c
dlls/wininet/tests/http.c
+17
-0
No files found.
dlls/wininet/internet.c
View file @
d3047aae
...
...
@@ -3781,7 +3781,11 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents,
}
if
(
lpUrlComponents
->
lpszHostName
)
{
*
lpdwUrlLength
+=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
HostName
);
if
(
lpUrlComponents
->
lpszUrlPath
&&
*
lpUrlComponents
->
lpszUrlPath
!=
'/'
)
(
*
lpdwUrlLength
)
++
;
/* '/' */
}
if
(
!
url_uses_default_port
(
nScheme
,
lpUrlComponents
->
nPort
))
{
...
...
@@ -4011,6 +4015,13 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
dwLen
=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
HostName
);
memcpy
(
lpszUrl
,
lpUrlComponents
->
lpszHostName
,
dwLen
*
sizeof
(
WCHAR
));
lpszUrl
+=
dwLen
;
/* add slash between hostname and path if necessary */
if
(
lpUrlComponents
->
lpszUrlPath
&&
*
lpUrlComponents
->
lpszUrlPath
!=
'/'
)
{
*
lpszUrl
=
'/'
;
lpszUrl
++
;
}
}
if
(
!
url_uses_default_port
(
nScheme
,
lpUrlComponents
->
nPort
))
...
...
dlls/wininet/tests/http.c
View file @
d3047aae
...
...
@@ -48,6 +48,7 @@
#define CREATE_URL7 "http://username:password@www.winehq.org:42/site/about"
#define CREATE_URL8 "https://username:password@www.winehq.org/site/about"
#define CREATE_URL9 "about:blank"
#define CREATE_URL10 "about://host/blank"
static
HANDLE
hCompleteEvent
;
...
...
@@ -1109,6 +1110,7 @@ static void InternetCreateUrlA_test(void)
urlComp
.
lpszUrlPath
=
"blank"
;
urlComp
.
dwUrlPathLength
=
5
;
len
=
strlen
(
CREATE_URL9
);
len
++
;
/* work around bug in native wininet */
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
ret
=
InternetCreateUrlA
(
&
urlComp
,
ICU_ESCAPE
,
szUrl
,
&
len
);
ok
(
ret
,
"Expected success
\n
"
);
...
...
@@ -1116,6 +1118,21 @@ static void InternetCreateUrlA_test(void)
ok
(
!
strcmp
(
szUrl
,
CREATE_URL9
),
"Expected %s, got %s
\n
"
,
CREATE_URL9
,
szUrl
);
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
lpszScheme
=
"about"
;
urlComp
.
lpszHostName
=
"host"
;
urlComp
.
lpszUrlPath
=
"blank"
;
len
=
strlen
(
CREATE_URL10
);
len
++
;
/* work around bug in native wininet */
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
ret
=
InternetCreateUrlA
(
&
urlComp
,
ICU_ESCAPE
,
szUrl
,
&
len
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
len
==
strlen
(
CREATE_URL10
),
"Expected len %d, got %ld
\n
"
,
strlen
(
CREATE_URL9
),
len
);
ok
(
!
strcmp
(
szUrl
,
CREATE_URL10
),
"Expected %s, got %s
\n
"
,
CREATE_URL9
,
szUrl
);
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
}
static
void
HttpSendRequestEx_test
(
void
)
...
...
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