From 2069b9946ea0c561d5c65bfc19baa202edeeaa91 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 11 Aug 2001 14:51:28 +0200 Subject: Fixed AddDirectory --- eit.c | 6 ++++-- tools.c | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/eit.c b/eit.c index 50f380f2..6584e598 100644 --- a/eit.c +++ b/eit.c @@ -13,7 +13,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (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" @@ -1140,7 +1140,9 @@ void cSIProcessor::SetEpgDataFileName(const char *FileName) 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) diff --git a/tools.c b/tools.c index bf07ad07..75e96487 100644 --- a/tools.c +++ b/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.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 @@ -117,10 +117,7 @@ const char *AddDirectory(const char *DirName, const char *FileName) { static char *buf = NULL; delete buf; - if (*FileName != '/') - asprintf(&buf, "%s/%s", DirName && *DirName ? DirName : ".", FileName); - else - buf = strdup(FileName); + asprintf(&buf, "%s/%s", DirName && *DirName ? DirName : ".", FileName); return buf; } -- cgit v1.2.3