Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
d710b22a
Commit
d710b22a
authored
Mar 07, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partially fix encoding of relative paths in playlist files
parent
ec70eaa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
8 deletions
+24
-8
modules/demux/playlist/playlist.c
modules/demux/playlist/playlist.c
+24
-8
No files found.
modules/demux/playlist/playlist.c
View file @
d710b22a
...
...
@@ -31,6 +31,10 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_demux.h>
#include <vlc_url.h>
#ifdef WIN32
# include <ctype.h>
#endif
#include "playlist.h"
...
...
@@ -225,19 +229,31 @@ char *ProcessMRL( const char *psz_mrl, const char *psz_prefix )
* PB: on some file systems, ':' are valid characters though */
/* Simple cases first */
if
(
!
psz_mrl
||
!*
psz_mrl
)
return
NULL
;
if
(
!
psz_prefix
||
!*
psz_prefix
)
return
strdup
(
psz_mrl
);
if
(
!
psz_mrl
||
!*
psz_mrl
)
return
NULL
;
if
(
!
psz_prefix
||
!*
psz_prefix
)
goto
uri
;
/* Check if the line specifies an absolute path */
if
(
*
psz_mrl
==
'/'
||
*
psz_mrl
==
'\\'
)
return
strdup
(
psz_mrl
);
/* Check if the line specifies an mrl/url
* (and on win32, contains a drive letter) */
if
(
strchr
(
psz_mrl
,
':'
)
)
return
strdup
(
psz_mrl
);
/* FIXME: that's wrong if the playlist is not a local file */
if
(
*
psz_mrl
==
DIR_SEP_CHAR
)
goto
uri
;
#ifdef WIN32
/* Drive letter (this assumes URL scheme are not a single character) */
if
(
isalpha
(
psz_mrl
[
0
])
&&
psz_mrl
[
1
]
==
':'
)
goto
uri
;
#endif
/* This a relative path, prepend the prefix */
char
*
ret
;
if
(
asprintf
(
&
ret
,
"%s%s"
,
psz_prefix
,
psz_mrl
)
==
-
1
)
char
*
postfix
=
encode_URI_component
(
psz_mrl
);
/* FIXME: postfix may not be encoded correctly (esp. slashes) */
if
(
postfix
==
NULL
||
asprintf
(
&
ret
,
"%s%s"
,
psz_prefix
,
postfix
)
==
-
1
)
ret
=
NULL
;
free
(
postfix
);
return
ret
;
uri:
return
make_URI
(
psz_mrl
);
}
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