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
dff300c0
Commit
dff300c0
authored
Jul 02, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebrowser: Support file URLs with a query or an anchor.
parent
02472551
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
10 deletions
+38
-10
main.c
programs/winebrowser/main.c
+38
-10
No files found.
programs/winebrowser/main.c
View file @
dff300c0
...
...
@@ -66,6 +66,15 @@ static char *strdup_unixcp( const WCHAR *str )
return
ret
;
}
static
WCHAR
*
strdupW
(
const
WCHAR
*
src
)
{
WCHAR
*
dst
;
if
(
!
src
)
return
NULL
;
if
((
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
strcpyW
(
dst
,
src
);
return
dst
;
}
/* try to launch a unix app from a comma separated string of app names */
static
int
launch_app
(
WCHAR
*
candidates
,
const
WCHAR
*
argv1
)
{
...
...
@@ -329,7 +338,7 @@ int wmain(int argc, WCHAR *argv[])
static
const
WCHAR
mailtoW
[]
=
{
'm'
,
'a'
,
'i'
,
'l'
,
't'
,
'o'
,
':'
,
0
};
static
const
WCHAR
fileW
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
0
};
WCHAR
*
url
=
argv
[
1
];
WCHAR
*
p
,
*
filenameW
=
NULL
,
*
fileurlW
=
NULL
,
*
url
=
argv
[
1
];
wine_get_unix_file_name_t
wine_get_unix_file_name_ptr
;
int
ret
=
1
;
...
...
@@ -347,7 +356,6 @@ int wmain(int argc, WCHAR *argv[])
/* handle an RFC1738 file URL */
if
(
!
strncmpiW
(
url
,
fileW
,
5
))
{
WCHAR
*
p
;
DWORD
len
=
strlenW
(
url
)
+
1
;
if
(
UrlUnescapeW
(
url
,
NULL
,
&
len
,
URL_UNESCAPE_INPLACE
)
!=
S_OK
)
...
...
@@ -390,20 +398,38 @@ int wmain(int argc, WCHAR *argv[])
else
{
char
*
unixpath
;
if
((
unixpath
=
wine_get_unix_file_name_ptr
(
url
)))
WCHAR
c
=
0
;
if
(
!
(
filenameW
=
strdupW
(
url
)))
goto
done
;
if
((
p
=
strchrW
(
filenameW
,
'?'
))
||
(
p
=
strchrW
(
filenameW
,
'#'
)))
{
c
=
*
p
;
*
p
=
0
;
}
if
((
unixpath
=
wine_get_unix_file_name_ptr
(
filenameW
)))
{
struct
stat
dummy
;
if
(
stat
(
unixpath
,
&
dummy
)
>=
0
)
{
int
len
;
WCHAR
*
unixpathW
;
static
const
WCHAR
schemeW
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
0
};
int
len
,
len_scheme
;
len
=
len_scheme
=
strlenW
(
schemeW
);
len
+=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
unixpath
,
-
1
,
NULL
,
0
);
if
(
p
)
{
*
p
=
c
;
len
+=
strlenW
(
p
);
}
if
(
!
(
fileurlW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
goto
done
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
unixpath
,
-
1
,
NULL
,
0
);
if
((
unixpathW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
unixpath
,
-
1
,
unixpathW
,
len
);
strcpyW
(
fileurlW
,
schemeW
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
unixpath
,
-
1
,
fileurlW
+
len_scheme
,
len
-
len_scheme
);
if
(
p
)
strcatW
(
fileurlW
,
p
);
ret
=
open_http_url
(
unixpathW
);
HeapFree
(
GetProcessHeap
(),
0
,
unixpathW
);
ret
=
open_http_url
(
fileurlW
);
goto
done
;
}
}
...
...
@@ -417,5 +443,7 @@ int wmain(int argc, WCHAR *argv[])
done:
HeapFree
(
GetProcessHeap
(),
0
,
ddeString
);
HeapFree
(
GetProcessHeap
(),
0
,
filenameW
);
HeapFree
(
GetProcessHeap
(),
0
,
fileurlW
);
return
ret
;
}
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