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
5af3b8c9
Commit
5af3b8c9
authored
Jul 01, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Jul 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebrowser: Don't use IUriBuilder with unix file: uri's.
parent
c5f00063
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
27 deletions
+12
-27
main.c
programs/winebrowser/main.c
+12
-27
No files found.
programs/winebrowser/main.c
View file @
5af3b8c9
...
@@ -311,11 +311,12 @@ done:
...
@@ -311,11 +311,12 @@ done:
static
WCHAR
*
encode_unix_path
(
const
char
*
src
)
static
WCHAR
*
encode_unix_path
(
const
char
*
src
)
{
{
int
len
=
1
;
const
char
*
tmp_src
;
const
char
*
tmp_src
;
WCHAR
*
dst
,
*
tmp_dst
;
WCHAR
*
dst
,
*
tmp_dst
;
const
char
safe_chars
[]
=
"/-_.~@&=+$,:"
;
const
char
safe_chars
[]
=
"/-_.~@&=+$,:"
;
const
char
hex_digits
[]
=
"0123456789ABCDEF"
;
const
char
hex_digits
[]
=
"0123456789ABCDEF"
;
const
WCHAR
schema
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
0
};
int
len
=
sizeof
(
schema
)
/
sizeof
(
schema
[
0
]);
tmp_src
=
src
;
tmp_src
=
src
;
...
@@ -336,8 +337,10 @@ static WCHAR *encode_unix_path(const char *src)
...
@@ -336,8 +337,10 @@ static WCHAR *encode_unix_path(const char *src)
if
(
!
dst
)
if
(
!
dst
)
return
NULL
;
return
NULL
;
strcpyW
(
dst
,
schema
);
tmp_src
=
src
;
tmp_src
=
src
;
tmp_dst
=
dst
;
tmp_dst
=
dst
+
strlenW
(
dst
)
;
while
(
*
tmp_src
!=
0
)
while
(
*
tmp_src
!=
0
)
{
{
...
@@ -362,15 +365,13 @@ static WCHAR *encode_unix_path(const char *src)
...
@@ -362,15 +365,13 @@ static WCHAR *encode_unix_path(const char *src)
return
dst
;
return
dst
;
}
}
static
IUri
*
convert_file_uri
(
IUri
*
uri
)
static
WCHAR
*
convert_file_uri
(
IUri
*
uri
)
{
{
wine_get_unix_file_name_t
wine_get_unix_file_name_ptr
;
wine_get_unix_file_name_t
wine_get_unix_file_name_ptr
;
IUriBuilder
*
uri_builder
;
struct
stat
dummy
;
struct
stat
dummy
;
WCHAR
*
new_path
;
WCHAR
*
new_path
;
char
*
unixpath
;
char
*
unixpath
;
BSTR
filename
;
BSTR
filename
;
IUri
*
new_uri
;
HRESULT
hres
;
HRESULT
hres
;
/* check if the argument is a local file */
/* check if the argument is a local file */
...
@@ -399,19 +400,7 @@ static IUri *convert_file_uri(IUri *uri)
...
@@ -399,19 +400,7 @@ static IUri *convert_file_uri(IUri *uri)
WINE_TRACE
(
"New path: %s
\n
"
,
wine_dbgstr_w
(
new_path
));
WINE_TRACE
(
"New path: %s
\n
"
,
wine_dbgstr_w
(
new_path
));
hres
=
CreateIUriBuilder
(
uri
,
0
,
0
,
&
uri_builder
);
return
new_path
;
if
(
SUCCEEDED
(
hres
)
&&
new_path
)
hres
=
IUriBuilder_SetPath
(
uri_builder
,
new_path
);
HeapFree
(
GetProcessHeap
(),
0
,
new_path
);
if
(
FAILED
(
hres
))
return
NULL
;
hres
=
IUriBuilder_CreateUri
(
uri_builder
,
0
,
0
,
0
,
&
new_uri
);
IUriBuilder_Release
(
uri_builder
);
if
(
FAILED
(
hres
))
return
NULL
;
return
new_uri
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -423,7 +412,7 @@ int wmain(int argc, WCHAR *argv[])
...
@@ -423,7 +412,7 @@ int wmain(int argc, WCHAR *argv[])
static
const
WCHAR
nohomeW
[]
=
{
'-'
,
'n'
,
'o'
,
'h'
,
'o'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
nohomeW
[]
=
{
'-'
,
'n'
,
'o'
,
'h'
,
'o'
,
'm'
,
'e'
,
0
};
WCHAR
*
url
=
argv
[
1
];
WCHAR
*
url
=
argv
[
1
];
BSTR
display_uri
;
BSTR
display_uri
=
NULL
;
DWORD
scheme
;
DWORD
scheme
;
IUri
*
uri
;
IUri
*
uri
;
HRESULT
hres
;
HRESULT
hres
;
...
@@ -451,18 +440,14 @@ int wmain(int argc, WCHAR *argv[])
...
@@ -451,18 +440,14 @@ int wmain(int argc, WCHAR *argv[])
IUri_GetScheme
(
uri
,
&
scheme
);
IUri_GetScheme
(
uri
,
&
scheme
);
if
(
scheme
==
URL_SCHEME_FILE
)
{
if
(
scheme
==
URL_SCHEME_FILE
)
{
IUri
*
file_uri
;
display_uri
=
convert_file_uri
(
uri
);
if
(
!
display_uri
)
{
file_uri
=
convert_file_uri
(
uri
);
if
(
file_uri
)
{
IUri_Release
(
uri
);
uri
=
file_uri
;
}
else
{
WINE_ERR
(
"Failed to convert file URL to unix path
\n
"
);
WINE_ERR
(
"Failed to convert file URL to unix path
\n
"
);
}
}
}
}
hres
=
IUri_GetDisplayUri
(
uri
,
&
display_uri
);
if
(
!
display_uri
)
hres
=
IUri_GetDisplayUri
(
uri
,
&
display_uri
);
IUri_Release
(
uri
);
IUri_Release
(
uri
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
-
1
;
return
-
1
;
...
...
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