Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
e105c631
Commit
e105c631
authored
Feb 10, 2015
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: fix opening of scripts on Windows on non-ASCII path
Close #13752
parent
d3985a2b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
modules/lua/vlc.c
modules/lua/vlc.c
+15
-5
No files found.
modules/lua/vlc.c
View file @
e105c631
...
@@ -834,15 +834,23 @@ int vlclua_add_modules_path( lua_State *L, const char *psz_filename )
...
@@ -834,15 +834,23 @@ int vlclua_add_modules_path( lua_State *L, const char *psz_filename )
}
}
/** Replacement for luaL_dofile, using VLC's input capabilities */
/** Replacement for luaL_dofile, using VLC's input capabilities */
int
vlclua_dofile
(
vlc_object_t
*
p_this
,
lua_State
*
L
,
const
char
*
uri
)
int
vlclua_dofile
(
vlc_object_t
*
p_this
,
lua_State
*
L
,
const
char
*
c
uri
)
{
{
if
(
!
strstr
(
uri
,
"://"
)
)
char
*
uri
=
ToLocaleDup
(
curi
);
return
luaL_dofile
(
L
,
uri
);
if
(
!
strstr
(
uri
,
"://"
)
)
{
if
(
!
strncasecmp
(
uri
,
"file://"
,
7
)
)
int
ret
=
luaL_dofile
(
L
,
uri
);
return
luaL_dofile
(
L
,
uri
+
7
);
free
(
uri
);
return
ret
;
}
if
(
!
strncasecmp
(
uri
,
"file://"
,
7
)
)
{
int
ret
=
luaL_dofile
(
L
,
uri
+
7
);
free
(
uri
);
return
ret
;
}
stream_t
*
s
=
stream_UrlNew
(
p_this
,
uri
);
stream_t
*
s
=
stream_UrlNew
(
p_this
,
uri
);
if
(
!
s
)
if
(
!
s
)
{
{
free
(
uri
);
return
1
;
return
1
;
}
}
int64_t
i_size
=
stream_Size
(
s
);
int64_t
i_size
=
stream_Size
(
s
);
...
@@ -851,6 +859,7 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *uri )
...
@@ -851,6 +859,7 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *uri )
{
{
// FIXME: read the whole stream until we reach the end (if no size)
// FIXME: read the whole stream until we reach the end (if no size)
stream_Delete
(
s
);
stream_Delete
(
s
);
free
(
uri
);
return
1
;
return
1
;
}
}
int64_t
i_read
=
stream_Read
(
s
,
p_buffer
,
(
int
)
i_size
);
int64_t
i_read
=
stream_Read
(
s
,
p_buffer
,
(
int
)
i_size
);
...
@@ -861,5 +870,6 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *uri )
...
@@ -861,5 +870,6 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *uri )
i_ret
=
lua_pcall
(
L
,
0
,
LUA_MULTRET
,
0
);
i_ret
=
lua_pcall
(
L
,
0
,
LUA_MULTRET
,
0
);
stream_Delete
(
s
);
stream_Delete
(
s
);
free
(
p_buffer
);
free
(
p_buffer
);
free
(
uri
);
return
i_ret
;
return
i_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