mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed handling ':' in timer filenames and '\n' in timer summaries
This commit is contained in:
parent
535e755278
commit
c0ed9649a3
6
FORMATS
6
FORMATS
@ -56,8 +56,10 @@ Video Disk Recorder File Formats
|
||||
- End time (first two digits for the hour, second two digits for the minutes)
|
||||
- Priority (from 00 to 99, 00 = lowest prioity, 99 = highest priority)
|
||||
- Guaranteed lifetime of recording (in days)
|
||||
- Name of timer (will be used to name the recording)
|
||||
- Summary
|
||||
- Name of timer (will be used to name the recording); if the name contains
|
||||
any ':' characters, these have to be replaced with '|'
|
||||
- Summary (any newline characters in the summary have to be replaced with '|';
|
||||
the summary may contain ':' characters)
|
||||
|
||||
* setup.conf
|
||||
|
||||
|
1
HISTORY
1
HISTORY
@ -388,3 +388,4 @@ Video Disk Recorder Revision History
|
||||
restore the list when switching between them.
|
||||
- The "Green" button in the "Recordings" menu can now be used to rewind a
|
||||
recording and play it from the very beginning.
|
||||
- Fixed handling ':' in timer filenames and '\n' in timer summaries (see FORMATS).
|
||||
|
8
config.c
8
config.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: config.c 1.40 2001/02/03 16:19:42 kls Exp $
|
||||
* $Id: config.c 1.41 2001/02/11 11:22:48 kls Exp $
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@ -368,7 +368,11 @@ cTimer& cTimer::operator= (const cTimer &Timer)
|
||||
const char *cTimer::ToText(cTimer *Timer)
|
||||
{
|
||||
delete buffer;
|
||||
strreplace(Timer->file, ':', '|');
|
||||
strreplace(Timer->summary, '\n', '|');
|
||||
asprintf(&buffer, "%d:%d:%s:%04d:%04d:%d:%d:%s:%s\n", Timer->active, Timer->channel, PrintDay(Timer->day), Timer->start, Timer->stop, Timer->priority, Timer->lifetime, Timer->file, Timer->summary ? Timer->summary : "");
|
||||
strreplace(Timer->summary, '|', '\n');
|
||||
strreplace(Timer->file, '|', ':');
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@ -457,6 +461,8 @@ bool cTimer::Parse(const char *s)
|
||||
//TODO add more plausibility checks
|
||||
day = ParseDay(buffer1);
|
||||
strn0cpy(file, buffer2, MaxFileName);
|
||||
strreplace(file, '|', ':');
|
||||
strreplace(summary, '|', '\n');
|
||||
delete buffer1;
|
||||
delete buffer2;
|
||||
delete s2;
|
||||
|
4
tools.c
4
tools.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: tools.c 1.28 2001/02/04 11:27:49 kls Exp $
|
||||
* $Id: tools.c 1.29 2001/02/11 11:18:45 kls Exp $
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
@ -51,7 +51,7 @@ char *strreplace(char *s, char c1, char c2)
|
||||
{
|
||||
char *p = s;
|
||||
|
||||
while (*p) {
|
||||
while (p && *p) {
|
||||
if (*p == c1)
|
||||
*p = c2;
|
||||
p++;
|
||||
|
Loading…
Reference in New Issue
Block a user