summaryrefslogtreecommitdiff
path: root/parse.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2012-04-07 16:55:39 +0200
committerJochen Dolze <vdr@dolze.de>2012-04-07 16:55:39 +0200
commit11d34a334a55b98950634be3612ed78eece8407d (patch)
tree48ec4082255ac2d87808e61db268e33240f9771f /parse.cpp
parent4d5bfc7c68db5776711b21fbcef70d02f22b5789 (diff)
downloadvdr-plugin-xmltv2vdr-11d34a334a55b98950634be3612ed78eece8407d.tar.gz
vdr-plugin-xmltv2vdr-11d34a334a55b98950634be3612ed78eece8407d.tar.bz2
Fixed execution check
Cosmetics and more (debug) output
Diffstat (limited to 'parse.cpp')
-rw-r--r--parse.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/parse.cpp b/parse.cpp
index c72ab48..969c728 100644
--- a/parse.cpp
+++ b/parse.cpp
@@ -99,10 +99,19 @@ time_t cParse::ConvertXMLTVTime2UnixTime(char *xmltvtime)
void cParse::RemoveNonAlphaNumeric(char *String)
{
if (!String) return;
+
+ // remove " Teil "
int len=strlen(String);
- char *p=String;
- int pos=0;
+ char *p=strstr(String," Teil ");
+ if (p)
+ {
+ memmove(p,p+6,len-6);
+ }
+ // remove non alphanumeric characters
+ len=strlen(String);
+ p=String;
+ int pos=0;
while (*p)
{
// 0x30 - 0x39
@@ -135,6 +144,7 @@ void cParse::RemoveNonAlphaNumeric(char *String)
break;
}
}
+
return;
}
@@ -143,6 +153,8 @@ bool cParse::FetchSeasonEpisode(iconv_t Conv, const char *EPDir, const char *Tit
{
if (!EPDir) return false;
if (!ShortText) return false;
+ size_t slen=strlen(ShortText);
+ if (!slen) return false;
if (!Title) return false;
if (Conv==(iconv_t) -1) return false;
@@ -176,7 +188,6 @@ bool cParse::FetchSeasonEpisode(iconv_t Conv, const char *EPDir, const char *Tit
return false;
}
- size_t slen=strlen(ShortText);
size_t dlen=4*slen;
char *dshorttext=(char *) calloc(dlen,1);
if (!dshorttext)
@@ -197,7 +208,13 @@ bool cParse::FetchSeasonEpisode(iconv_t Conv, const char *EPDir, const char *Tit
}
RemoveNonAlphaNumeric(dshorttext);
-
+ if (!strlen(dshorttext))
+ {
+ free(dshorttext);
+ fclose(f);
+ free(epfile);
+ return false;
+ }
char *line=NULL;
size_t length;