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
1db77bbb
Commit
1db77bbb
authored
Apr 23, 2006
by
Jérome Decoodt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add %T modifier to filename refs: #561
parent
df7d82b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
modules/access_output/file.c
modules/access_output/file.c
+36
-3
No files found.
modules/access_output/file.c
View file @
1db77bbb
...
...
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <errno.h>
...
...
@@ -129,9 +130,41 @@ static int Open( vlc_object_t *p_this )
else
{
const
char
*
psz_localname
=
ToLocale
(
p_access
->
psz_name
);
int
fd
=
open
(
psz_localname
,
i_flags
,
0666
);
LocaleFree
(
psz_localname
);
char
*
psz_tmp
,
*
psz_tmp2
,
*
psz_rewriten
;
int
fd
,
i
,
i_length
=
strlen
(
psz_localname
);
for
(
i
=
0
,
psz_tmp
=
psz_localname
;
(
psz_tmp
=
strstr
(
psz_tmp
,
"%T"
)
)
;
psz_tmp
++
,
i
++
)
;
if
(
i
)
{
i_length
+=
32
*
i
;
psz_rewriten
=
(
char
*
)
malloc
(
i_length
);
if
(
!
psz_rewriten
)
return
(
VLC_EGENERIC
);
psz_tmp
=
psz_localname
;
psz_tmp2
=
psz_rewriten
;
while
(
*
psz_tmp
)
{
if
(
(
*
psz_tmp
==
'%'
)
&&
(
*
(
psz_tmp
+
1
)
==
'T'
)
)
{
time_t
t
;
time
(
&
t
);
psz_tmp2
+=
sprintf
(
psz_tmp2
,
"%d"
,
(
int
)
t
);
psz_tmp
+=
2
;
}
else
*
psz_tmp2
++
=
*
psz_tmp
++
;
}
*
psz_tmp2
=
*
psz_tmp
;
fd
=
open
(
psz_rewriten
,
i_flags
,
0666
);
LocaleFree
(
psz_localname
);
free
(
psz_rewriten
);
}
else
{
fd
=
open
(
psz_localname
,
i_flags
,
0666
);
LocaleFree
(
psz_localname
);
}
if
(
fd
==
-
1
)
{
msg_Err
(
p_access
,
"cannot open `%s' (%s)"
,
p_access
->
psz_name
,
...
...
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