diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-02 15:21:54 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-02 15:21:54 +0200 |
commit | 22ccf22f6f4c2dd94e322f0aebf134a90b310fae (patch) | |
tree | 5d6d38dc2b94ff37150f38b3248636ae5e1cfd5a /videodir.c | |
parent | 0d7571054579614f9278999077921942ca08a7bf (diff) | |
download | vdr-22ccf22f6f4c2dd94e322f0aebf134a90b310fae.tar.gz vdr-22ccf22f6f4c2dd94e322f0aebf134a90b310fae.tar.bz2 |
Using subtitle for repeating timers; taking summary at recording time
Diffstat (limited to 'videodir.c')
-rw-r--r-- | videodir.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: videodir.c 1.5 2001/05/01 09:48:57 kls Exp $ + * $Id: videodir.c 1.6 2001/09/02 14:55:15 kls Exp $ */ #include "videodir.h" @@ -188,13 +188,21 @@ const char *PrefixVideoFileName(const char *FileName, char Prefix) if (!PrefixedName || strlen(PrefixedName) <= strlen(FileName)) PrefixedName = (char *)realloc(PrefixedName, strlen(FileName) + 2); if (PrefixedName) { - strcpy(PrefixedName, VideoDirectory); - char *p = PrefixedName + strlen(PrefixedName); - *p++ = '/'; - *p++ = Prefix; - strcpy(p, FileName + strlen(VideoDirectory) + 1); + const char *p = FileName + strlen(FileName); // p points at the terminating 0 + int n = 2; + while (p-- > FileName && n > 0) { + if (*p == '/') { + if (--n == 0) { + int l = p - FileName + 1; + strncpy(PrefixedName, FileName, l); + PrefixedName[l] = Prefix; + strcpy(PrefixedName + l + 1, p + 1); + return PrefixedName; + } + } + } } - return PrefixedName; + return NULL; } void RemoveEmptyVideoDirectories(void) |