Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
91e5760e
Commit
91e5760e
authored
Aug 17, 2005
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/access/file.c: Expansion of '~/' in filenames.
parent
3368c030
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
modules/access/file.c
modules/access/file.c
+18
-4
No files found.
modules/access/file.c
View file @
91e5760e
...
@@ -148,7 +148,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -148,7 +148,7 @@ static int Open( vlc_object_t *p_this )
{
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
access_t
*
p_access
=
(
access_t
*
)
p_this
;
access_sys_t
*
p_sys
;
access_sys_t
*
p_sys
;
char
*
psz_name
=
p_access
->
psz_path
;
char
*
psz_name
=
strdup
(
p_access
->
psz_path
)
;
char
*
psz
;
char
*
psz
;
#ifdef HAVE_SYS_STAT_H
#ifdef HAVE_SYS_STAT_H
...
@@ -161,19 +161,31 @@ static int Open( vlc_object_t *p_this )
...
@@ -161,19 +161,31 @@ static int Open( vlc_object_t *p_this )
b_stdin
=
psz_name
[
0
]
==
'-'
&&
psz_name
[
1
]
==
'\0'
;
b_stdin
=
psz_name
[
0
]
==
'-'
&&
psz_name
[
1
]
==
'\0'
;
#ifdef HAVE_SYS_STAT_H
if
(
!
b_stdin
)
if
(
!
b_stdin
)
{
{
if
(
psz_name
[
0
]
==
'~'
&&
psz_name
[
1
]
==
'/'
)
{
psz
=
malloc
(
strlen
(
p_access
->
p_vlc
->
psz_homedir
)
+
strlen
(
psz_name
)
);
/* This is incomplete : we should also support the ~cmassiot/
* syntax. */
sprintf
(
psz
,
"%s/%s"
,
p_access
->
p_vlc
->
psz_homedir
,
psz_name
+
2
);
free
(
psz_name
);
psz_name
=
psz
;
}
#ifdef HAVE_SYS_STAT_H
psz
=
ToLocale
(
psz_name
);
psz
=
ToLocale
(
psz_name
);
if
(
stat
(
psz
,
&
stat_info
)
)
if
(
stat
(
psz
,
&
stat_info
)
)
{
{
msg_Warn
(
p_access
,
"%s: %s"
,
psz_name
,
strerror
(
errno
)
);
msg_Warn
(
p_access
,
"%s: %s"
,
psz_name
,
strerror
(
errno
)
);
LocaleFree
(
psz
);
LocaleFree
(
psz
);
free
(
psz_name
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
LocaleFree
(
psz
);
LocaleFree
(
psz
);
}
#endif
#endif
}
p_access
->
pf_read
=
Read
;
p_access
->
pf_read
=
Read
;
p_access
->
pf_block
=
NULL
;
p_access
->
pf_block
=
NULL
;
...
@@ -253,6 +265,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -253,6 +265,7 @@ static int Open( vlc_object_t *p_this )
else
if
(
_OpenFile
(
p_access
,
psz_name
)
)
else
if
(
_OpenFile
(
p_access
,
psz_name
)
)
{
{
free
(
p_sys
);
free
(
p_sys
);
free
(
psz_name
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -261,6 +274,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -261,6 +274,7 @@ static int Open( vlc_object_t *p_this )
/* FIXME that's bad because all others access will be probed */
/* FIXME that's bad because all others access will be probed */
msg_Err
(
p_access
,
"file %s is empty, aborting"
,
psz_name
);
msg_Err
(
p_access
,
"file %s is empty, aborting"
,
psz_name
);
free
(
p_sys
);
free
(
p_sys
);
free
(
psz_name
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -272,7 +286,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -272,7 +286,7 @@ static int Open( vlc_object_t *p_this )
*/
*/
p_file
=
malloc
(
sizeof
(
file_entry_t
)
);
p_file
=
malloc
(
sizeof
(
file_entry_t
)
);
p_file
->
i_size
=
p_access
->
info
.
i_size
;
p_file
->
i_size
=
p_access
->
info
.
i_size
;
p_file
->
psz_name
=
strdup
(
psz_name
)
;
p_file
->
psz_name
=
psz_name
;
TAB_APPEND
(
p_sys
->
i_file
,
p_sys
->
file
,
p_file
);
TAB_APPEND
(
p_sys
->
i_file
,
p_sys
->
file
,
p_file
);
psz
=
var_CreateGetString
(
p_access
,
"file-cat"
);
psz
=
var_CreateGetString
(
p_access
,
"file-cat"
);
...
...
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