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
9c030d46
Commit
9c030d46
authored
Jun 27, 2008
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Jun 30, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: UrlCanonicalize should strip all the characters <= 32 from the end of the string.
parent
f8a104f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
url.c
dlls/shlwapi/tests/url.c
+16
-0
url.c
dlls/shlwapi/url.c
+1
-1
internet.c
dlls/wininet/tests/internet.c
+6
-0
No files found.
dlls/shlwapi/tests/url.c
View file @
9c030d46
...
...
@@ -579,6 +579,7 @@ static void test_UrlCanonicalizeW(void)
DWORD
dwSize
;
DWORD
urllen
;
HRESULT
hr
;
int
i
;
if
(
!
pUrlCanonicalizeW
)
{
...
...
@@ -628,6 +629,21 @@ static void test_UrlCanonicalizeW(void)
"got 0x%x with %u and size %u for %u (expected 'S_OK' and size %u)
\n
"
,
hr
,
GetLastError
(),
dwSize
,
lstrlenW
(
szReturnUrl
),
urllen
);
/* check that the characters 1..32 are chopped from the end of the string */
for
(
i
=
1
;
i
<
65536
;
i
++
)
{
WCHAR
szUrl
[
128
];
BOOL
choped
;
int
pos
;
MultiByteToWideChar
(
CP_UTF8
,
0
,
"http://www.winehq.org/X"
,
-
1
,
szUrl
,
128
);
pos
=
lstrlenW
(
szUrl
)
-
1
;
szUrl
[
pos
]
=
i
;
urllen
=
INTERNET_MAX_URL_LENGTH
;
pUrlCanonicalizeW
(
szUrl
,
szReturnUrl
,
&
urllen
,
0
);
choped
=
lstrlenW
(
szReturnUrl
)
<
lstrlenW
(
szUrl
);
ok
(
choped
==
(
i
<=
32
),
"Incorrect char chopping for char %d
\n
"
,
i
);
}
}
/* ########################### */
...
...
dlls/shlwapi/url.c
View file @
9c030d46
...
...
@@ -502,7 +502,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
debugstr_w
(
pszUrl
),
debugstr_w
(
lpszUrlCpy
));
}
nLen
=
lstrlenW
(
lpszUrlCpy
);
while
((
nLen
>
0
)
&&
((
lpszUrlCpy
[
nLen
-
1
]
==
'\r'
)
||
(
lpszUrlCpy
[
nLen
-
1
]
==
'\n
'
)))
while
((
nLen
>
0
)
&&
((
lpszUrlCpy
[
nLen
-
1
]
<=
'
'
)))
lpszUrlCpy
[
--
nLen
]
=
0
;
if
(
dwFlags
&
(
URL_UNESCAPE
|
URL_FILE_USE_PATHURL
))
...
...
dlls/wininet/tests/internet.c
View file @
9c030d46
...
...
@@ -113,6 +113,12 @@ static void test_InternetCanonicalizeUrlA(void)
"got %u and %u with size %u for '%s' (%d)
\n
"
,
res
,
GetLastError
(),
dwSize
,
buffer
,
lstrlenA
(
buffer
));
/* test with trailing space */
dwSize
=
256
;
res
=
InternetCanonicalizeUrlA
(
"http://www.winehq.org/index.php?x= "
,
buffer
,
&
dwSize
,
ICU_BROWSER_MODE
);
ok
(
res
==
1
,
"InternetCanonicalizeUrlA failed
\n
"
);
ok
(
!
strcmp
(
buffer
,
"http://www.winehq.org/index.php?x="
),
"Trailing space should have been stripped even in ICU_BROWSER_MODE (%s)
\n
"
,
buffer
);
res
=
InternetSetOptionA
(
NULL
,
0xdeadbeef
,
buffer
,
sizeof
(
buffer
));
ok
(
!
res
,
"InternetSetOptionA succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_INVALID_OPTION
,
...
...
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