summaryrefslogtreecommitdiff
path: root/timers.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2008-02-15 15:46:07 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2008-02-15 15:46:07 +0100
commita81e3699d13527ac8651969ddf0e0e411915d313 (patch)
treecd5655fa13522d41c545acb0ed06d8ac9269be3a /timers.c
parent9495aa9923fed16aeb6f49c69ccd249b9e17dba7 (diff)
downloadvdr-a81e3699d13527ac8651969ddf0e0e411915d313.tar.gz
vdr-a81e3699d13527ac8651969ddf0e0e411915d313.tar.bz2
Limiting the length of the recording name in timers in case VDR is run with --vfat (replaces the previous change to svdrp.c)
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/timers.c b/timers.c
index a0e0da0e..1e9feec2 100644
--- a/timers.c
+++ b/timers.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: timers.c 1.71 2008/02/10 16:26:25 kls Exp $
+ * $Id: timers.c 1.72 2008/02/15 15:36:59 kls Exp $
*/
#include "timers.h"
@@ -13,8 +13,11 @@
#include "device.h"
#include "i18n.h"
#include "libsi/si.h"
+#include "recording.h"
#include "remote.h"
+#define VFAT_MAX_FILENAME 40 // same as MAX_SUBTITLE_LENGTH in recording.c
+
// IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
// format characters in order to allow any number of blanks after a numeric
// value!
@@ -285,6 +288,18 @@ bool cTimer::Parse(const char *s)
}
//TODO add more plausibility checks
result = ParseDay(daybuffer, day, weekdays);
+ if (VfatFileSystem) {
+ char *p = strrchr(filebuffer, '~');
+ if (p)
+ p++;
+ else
+ p = filebuffer;
+ if (strlen(p) > VFAT_MAX_FILENAME) {
+ dsyslog("timer file name too long for VFAT file system: '%s'", p);
+ p[VFAT_MAX_FILENAME] = 0;
+ dsyslog("timer file name truncated to '%s'", p);
+ }
+ }
Utf8Strn0Cpy(file, filebuffer, MaxFileName);
strreplace(file, '|', ':');
if (isnumber(channelbuffer))