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
366fc247
Commit
366fc247
authored
Mar 14, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Make InternetCrackUrlW set the components related to net_loc
to NULL when net_loc isn't present in the input URL.
parent
153aac01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
9 deletions
+43
-9
internet.c
dlls/wininet/internet.c
+13
-9
http.c
dlls/wininet/tests/http.c
+30
-0
No files found.
dlls/wininet/internet.c
View file @
366fc247
...
...
@@ -1337,13 +1337,13 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
break
;
}
lpUC
->
nScheme
=
INTERNET_SCHEME_UNKNOWN
;
lpUC
->
nPort
=
INTERNET_INVALID_PORT_NUMBER
;
/* Parse <params> */
lpszParam
=
strpbrkW
(
lpszap
,
lpszSeparators
);
if
(
lpszParam
!=
NULL
)
{
SetUrlComponentValueW
(
&
lpUC
->
lpszExtraInfo
,
&
lpUC
->
dwExtraInfoLength
,
lpszParam
,
dwUrlLength
-
(
lpszParam
-
lpszUrl
));
}
SetUrlComponentValueW
(
&
lpUC
->
lpszExtraInfo
,
&
lpUC
->
dwExtraInfoLength
,
lpszParam
,
lpszParam
?
dwUrlLength
-
(
lpszParam
-
lpszUrl
)
:
0
);
if
(
bIsAbsolute
)
/* Parse <protocol>:[//<net_loc>] */
{
...
...
@@ -1425,7 +1425,6 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
{
SetUrlComponentValueW
(
&
lpUC
->
lpszHostName
,
&
lpUC
->
dwHostNameLength
,
lpszHost
,
lpszPort
-
lpszHost
);
lpUC
->
nPort
=
0
;
lpszcp
=
lpszNetLoc
;
}
else
...
...
@@ -1444,7 +1443,6 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
lpszcp
=
lpszHost
;
SetUrlComponentValueW
(
&
lpUC
->
lpszHostName
,
&
lpUC
->
dwHostNameLength
,
NULL
,
0
);
lpUC
->
nPort
=
0
;
}
else
{
...
...
@@ -1467,7 +1465,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
lpUC
->
nPort
=
INTERNET_DEFAULT_GOPHER_PORT
;
break
;
default:
lpUC
->
nPort
=
INTERNET_INVALID_PORT_NUMBER
;
break
;
}
}
}
...
...
@@ -1478,9 +1476,15 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
SetUrlComponentValueW
(
&
lpUC
->
lpszUserName
,
&
lpUC
->
dwUserNameLength
,
NULL
,
0
);
SetUrlComponentValueW
(
&
lpUC
->
lpszPassword
,
&
lpUC
->
dwPasswordLength
,
NULL
,
0
);
SetUrlComponentValueW
(
&
lpUC
->
lpszHostName
,
&
lpUC
->
dwHostNameLength
,
NULL
,
0
);
lpUC
->
nPort
=
0
;
}
}
else
{
SetUrlComponentValueW
(
&
lpUC
->
lpszScheme
,
&
lpUC
->
dwSchemeLength
,
NULL
,
0
);
SetUrlComponentValueW
(
&
lpUC
->
lpszUserName
,
&
lpUC
->
dwUserNameLength
,
NULL
,
0
);
SetUrlComponentValueW
(
&
lpUC
->
lpszPassword
,
&
lpUC
->
dwPasswordLength
,
NULL
,
0
);
SetUrlComponentValueW
(
&
lpUC
->
lpszHostName
,
&
lpUC
->
dwHostNameLength
,
NULL
,
0
);
}
/* Here lpszcp points to:
*
...
...
dlls/wininet/tests/http.c
View file @
366fc247
...
...
@@ -683,6 +683,7 @@ static void InternetCrackUrlW_test(void)
'C'
,
'F'
,
'I'
,
'D'
,
'E'
,
'/'
,
'm'
,
'a'
,
'i'
,
'n'
,
'.'
,
'c'
,
'f'
,
'm'
,
'?'
,
'C'
,
'F'
,
'S'
,
'V'
,
'R'
,
'='
,
'I'
,
'D'
,
'E'
,
'&'
,
'A'
,
'C'
,
'T'
,
'I'
,
'O'
,
'N'
,
'='
,
'I'
,
'D'
,
'E'
,
'_'
,
'D'
,
'E'
,
'F'
,
'A'
,
'U'
,
'L'
,
'T'
,
0
};
static
const
WCHAR
url2
[]
=
{
'.'
,
'.'
,
'/'
,
'R'
,
'i'
,
't'
,
'z'
,
'.'
,
'x'
,
'm'
,
'l'
,
0
};
URL_COMPONENTSW
comp
;
WCHAR
scheme
[
20
],
host
[
20
],
user
[
20
],
pwd
[
20
],
urlpart
[
50
],
extra
[
50
];
BOOL
r
;
...
...
@@ -762,6 +763,35 @@ static void InternetCrackUrlW_test(void)
ok
(
comp
.
dwPasswordLength
==
0
,
"password length wrong
\n
"
);
ok
(
comp
.
dwUrlPathLength
==
15
,
"url length wrong
\n
"
);
ok
(
comp
.
dwExtraInfoLength
==
29
,
"extra length wrong
\n
"
);
urlpart
[
0
]
=
0
;
scheme
[
0
]
=
0
;
extra
[
0
]
=
0
;
host
[
0
]
=
0
;
user
[
0
]
=
0
;
pwd
[
0
]
=
0
;
memset
(
&
comp
,
0
,
sizeof
(
comp
));
comp
.
dwStructSize
=
sizeof
(
comp
);
comp
.
lpszScheme
=
scheme
;
comp
.
dwSchemeLength
=
sizeof
(
scheme
)
/
sizeof
(
scheme
[
0
]);
comp
.
lpszHostName
=
host
;
comp
.
dwHostNameLength
=
sizeof
(
host
)
/
sizeof
(
host
[
0
]);
comp
.
lpszUserName
=
user
;
comp
.
dwUserNameLength
=
sizeof
(
user
)
/
sizeof
(
user
[
0
]);
comp
.
lpszPassword
=
pwd
;
comp
.
dwPasswordLength
=
sizeof
(
pwd
)
/
sizeof
(
pwd
[
0
]);
comp
.
lpszUrlPath
=
urlpart
;
comp
.
dwUrlPathLength
=
sizeof
(
urlpart
)
/
sizeof
(
urlpart
[
0
]);
comp
.
lpszExtraInfo
=
extra
;
comp
.
dwExtraInfoLength
=
sizeof
(
extra
)
/
sizeof
(
extra
[
0
]);
r
=
InternetCrackUrlW
(
url2
,
0
,
0
,
&
comp
);
ok
(
r
,
"InternetCrackUrl failed, error %lx
\n
"
,
GetLastError
());
ok
(
!
comp
.
dwSchemeLength
,
".dwSchemeLength should be 0, but is %ld
\n
"
,
comp
.
dwSchemeLength
);
ok
(
!
comp
.
dwHostNameLength
,
".dwHostNameLength should be 0, but is %ld
\n
"
,
comp
.
dwHostNameLength
);
ok
(
!
comp
.
dwUserNameLength
,
".dwUserNameLength should be 0, but is %ld
\n
"
,
comp
.
dwUserNameLength
);
ok
(
!
comp
.
dwPasswordLength
,
".dwPasswordLength should be 0, but is %ld
\n
"
,
comp
.
dwPasswordLength
);
ok
(
!
comp
.
dwExtraInfoLength
,
".dwExtraInfoLength should be 0, but is %ld
\n
"
,
comp
.
dwExtraInfoLength
);
}
static
void
InternetTimeFromSystemTimeA_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