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
6c6ab104
Commit
6c6ab104
authored
Jun 24, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: handle relative paths properly
(cherry picked from commit
6bf70b22
)
parent
1e924a43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
23 deletions
+2
-23
modules/access/directory.c
modules/access/directory.c
+2
-23
No files found.
modules/access/directory.c
View file @
6c6ab104
...
...
@@ -221,27 +221,6 @@ static void Close( vlc_object_t * p_this )
free
(
p_sys
);
}
/**
* URI-encodes a file path. The only reserved characters is slash.
*/
static
char
*
encode_path
(
const
char
*
path
)
{
static
const
char
sep
[]
=
"%2F"
;
char
*
enc
=
encode_URI_component
(
path
),
*
ptr
=
enc
;
if
(
enc
==
NULL
)
return
NULL
;
/* Replace '%2F' with '/'. TODO: extend encode_URI*() */
/* (On Windows, both ':' and '\\' will be encoded) */
while
((
ptr
=
strstr
(
ptr
,
sep
))
!=
NULL
)
{
*
ptr
++
=
'/'
;
memmove
(
ptr
,
ptr
+
2
,
strlen
(
ptr
)
-
1
);
}
return
enc
;
}
/* Detect directories that recurse into themselves. */
static
bool
has_inode_loop
(
const
directory_t
*
dir
)
{
...
...
@@ -287,7 +266,7 @@ static block_t *Block (access_t *p_access)
current
->
parent
=
NULL
;
current
->
handle
=
p_sys
->
handle
;
strcpy
(
current
->
path
,
p_access
->
psz_path
);
current
->
uri
=
encode_path
(
current
->
path
);
current
->
uri
=
make_URI
(
current
->
path
);
if
((
current
->
uri
==
NULL
)
||
fstat
(
dirfd
(
current
->
handle
),
&
current
->
st
))
{
...
...
@@ -446,7 +425,7 @@ static block_t *Block (access_t *p_access)
if
(
encoded
==
NULL
)
goto
fatal
;
int
len
=
asprintf
(
&
entry
,
" <track><location>
file://
%s/%s</location>
\n
"
\
" <track><location>%s/%s</location>
\n
"
\
" <extension application=
\"
http://www.videolan.org/vlc/playlist/0
\"
>
\n
"
\
" <vlc:id>%d</vlc:id>
\n
"
\
" </extension>
\n
"
\
...
...
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