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
11a0c8cd
Commit
11a0c8cd
authored
Jan 11, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: UrlCanonicalize: fix URL_DONT_SIMPLIFY.
- URL_DONT_SIMPLIFY should change '/' <-> '\' - Better '/' / '\' handling
parent
50c64c04
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
path.c
dlls/shlwapi/tests/path.c
+6
-1
url.c
dlls/shlwapi/url.c
+9
-10
No files found.
dlls/shlwapi/tests/path.c
View file @
11a0c8cd
...
...
@@ -72,7 +72,9 @@ const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
{
"file://c:/tests/../tests/foo%20bar"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"file://c:
\\
tests
\\
foo bar"
},
{
"file://c:/tests
\\
../tests/foo%20bar"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"file://c:
\\
tests
\\
foo bar"
},
{
"file://c:/tests/foo%20bar"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"file://c:
\\
tests
\\
foo bar"
},
{
"file:///c://tests/foo%20bar"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"file://c:
\\\\
tests
\\
foo bar"
}
{
"file:///c://tests/foo%20bar"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"file://c:
\\\\
tests
\\
foo bar"
},
{
"file:///c:
\\
tests
\\
foo bar"
,
0
,
S_OK
,
"file:///c:/tests/foo bar"
},
{
"file:///c:
\\
tests
\\
foo bar"
,
URL_DONT_SIMPLIFY
,
S_OK
,
"file:///c:/tests/foo bar"
},
};
typedef
struct
_TEST_URL_ESCAPE
{
...
...
@@ -174,8 +176,10 @@ typedef struct _TEST_URL_COMBINE {
const
TEST_URL_COMBINE
TEST_COMBINE
[]
=
{
{
"http://www.winehq.org/tests"
,
"tests1"
,
0
,
S_OK
,
"http://www.winehq.org/tests1"
},
{
"http://www.%77inehq.org/tests"
,
"tests1"
,
0
,
S_OK
,
"http://www.%77inehq.org/tests1"
},
/*FIXME {"http://www.winehq.org/tests", "../tests2", 0, S_OK, "http://www.winehq.org/tests2"},*/
{
"http://www.winehq.org/tests/"
,
"../tests3"
,
0
,
S_OK
,
"http://www.winehq.org/tests3"
},
{
"http://www.winehq.org/tests/test1"
,
"test2"
,
0
,
S_OK
,
"http://www.winehq.org/tests/test2"
},
{
"http://www.winehq.org/tests/../tests"
,
"tests4"
,
0
,
S_OK
,
"http://www.winehq.org/tests4"
},
{
"http://www.winehq.org/tests/../tests/"
,
"tests5"
,
0
,
S_OK
,
"http://www.winehq.org/tests/tests5"
},
{
"http://www.winehq.org/tests/../tests/"
,
"/tests6/.."
,
0
,
S_OK
,
"http://www.winehq.org/"
},
...
...
@@ -184,6 +188,7 @@ const TEST_URL_COMBINE TEST_COMBINE[] = {
{
"http://www.winehq.org/tests/#example"
,
"tests9"
,
0
,
S_OK
,
"http://www.winehq.org/tests/tests9"
},
{
"http://www.winehq.org/tests/../tests/"
,
"/tests10/.."
,
URL_DONT_SIMPLIFY
,
S_OK
,
"http://www.winehq.org/tests10/.."
},
{
"http://www.winehq.org/tests/../"
,
"tests11"
,
URL_DONT_SIMPLIFY
,
S_OK
,
"http://www.winehq.org/tests/../tests11"
},
{
"file:///C:
\\
dir
\\
file.txt"
,
"test.txt"
,
0
,
S_OK
,
"file:///C:/dir/test.txt"
}
};
struct
{
...
...
dlls/shlwapi/url.c
View file @
11a0c8cd
...
...
@@ -341,10 +341,6 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
nByteLen
=
(
lstrlenW
(
pszUrl
)
+
1
)
*
sizeof
(
WCHAR
);
/* length in bytes */
lpszUrlCpy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nByteLen
);
if
(
dwFlags
&
URL_DONT_SIMPLIFY
)
memcpy
(
lpszUrlCpy
,
pszUrl
,
nByteLen
);
else
{
/*
* state =
* 0 initial 1,3
...
...
@@ -377,7 +373,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
*
wk2
++
=
*
wk1
++
;
if
(
*
wk1
!=
L'/'
)
{
state
=
6
;
break
;}
*
wk2
++
=
*
wk1
++
;
if
((
dwFlags
&
URL_FILE_USE_PATHURL
)
&&
*
wk1
==
'/'
)
if
(
*
wk1
==
'/'
&&
(
dwFlags
&
URL_FILE_USE_PATHURL
)
)
wk1
++
;
state
=
4
;
break
;
...
...
@@ -403,22 +399,26 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
break
;
case
5
:
if
(
*
wk1
!=
'/'
&&
*
wk1
!=
'\\'
)
{
state
=
3
;
break
;}
while
(
*
wk1
==
'/
'
)
{
while
(
*
wk1
==
'/'
||
*
wk1
==
'\\
'
)
{
*
wk2
++
=
slash
;
wk1
++
;
}
state
=
6
;
break
;
case
6
:
if
(
dwFlags
&
URL_DONT_SIMPLIFY
)
{
state
=
3
;
break
;
}
/* Now at root location, cannot back up any more. */
/* "root" will point at the '/' */
root
=
wk2
-
1
;
while
(
*
wk1
)
{
TRACE
(
"wk1=%c
\n
"
,
(
CHAR
)
*
wk1
);
mp
=
strchrW
(
wk1
,
'/'
);
mp2
=
strchrW
(
wk1
,
'\\'
);
if
(
mp2
&&
mp2
<
mp
)
if
(
mp2
&&
(
!
mp
||
mp2
<
mp
)
)
mp
=
mp2
;
if
(
!
mp
)
{
nWkLen
=
strlenW
(
wk1
);
...
...
@@ -474,7 +474,6 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
HeapFree
(
GetProcessHeap
(),
0
,
lpszUrlCpy
);
return
E_INVALIDARG
;
}
}
*
wk2
=
L'\0'
;
TRACE
(
"Simplified, orig <%s>, simple <%s>
\n
"
,
debugstr_w
(
pszUrl
),
debugstr_w
(
lpszUrlCpy
));
...
...
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