1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed AddDirectory

This commit is contained in:
Klaus Schmidinger 2001-08-11 14:51:28 +02:00
parent 8e7c06006f
commit 2069b9946e
2 changed files with 6 additions and 7 deletions

6
eit.c
View File

@ -13,7 +13,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* $Id: eit.c 1.17 2001/08/11 09:31:54 kls Exp $ * $Id: eit.c 1.18 2001/08/11 14:51:28 kls Exp $
***************************************************************************/ ***************************************************************************/
#include "eit.h" #include "eit.h"
@ -1140,7 +1140,9 @@ void cSIProcessor::SetEpgDataFileName(const char *FileName)
const char *cSIProcessor::GetEpgDataFileName(void) const char *cSIProcessor::GetEpgDataFileName(void)
{ {
return epgDataFileName ? AddDirectory(VideoDirectory, epgDataFileName) : NULL; if (epgDataFileName)
return *epgDataFileName == '/' ? epgDataFileName : AddDirectory(VideoDirectory, epgDataFileName);
return NULL;
} }
void cSIProcessor::SetStatus(bool On) void cSIProcessor::SetStatus(bool On)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: tools.c 1.37 2001/08/11 11:14:19 kls Exp $ * $Id: tools.c 1.38 2001/08/11 14:49:48 kls Exp $
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
@ -117,10 +117,7 @@ const char *AddDirectory(const char *DirName, const char *FileName)
{ {
static char *buf = NULL; static char *buf = NULL;
delete buf; delete buf;
if (*FileName != '/')
asprintf(&buf, "%s/%s", DirName && *DirName ? DirName : ".", FileName); asprintf(&buf, "%s/%s", DirName && *DirName ? DirName : ".", FileName);
else
buf = strdup(FileName);
return buf; return buf;
} }