From 5c5359cf94bf9de90d6eb10daa2c83db30cfb06e Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Mon, 7 May 2012 19:14:03 +0200 Subject: format specifier in epgsearchcats.conf, thanks to Joe_D for a patch --- epgsearchcats.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'epgsearchcats.c') diff --git a/epgsearchcats.c b/epgsearchcats.c index 5458369..8428ac2 100644 --- a/epgsearchcats.c +++ b/epgsearchcats.c @@ -34,6 +34,7 @@ cSearchExtCat::cSearchExtCat(void) { id = 0; name = NULL; + format = NULL; menuname = NULL; searchmode = 1; // default: all substrings must exist values = NULL; @@ -82,8 +83,19 @@ bool cSearchExtCat::Parse(const char *s) switch (parameter) { case 1: id = atoi(value); break; - case 2: name = strdup(value); - break; + case 2: + { + name = strdup(value); + format=strchr(name,','); + if (format) + { + *format=0; + format++; + char cset[]="%0123456789di"; + if (strspn(format,cset)!=strlen(format)) format=NULL; + } + break; + } case 3: menuname = strdup(value); break; case 4: @@ -128,8 +140,14 @@ const char *cSearchExtCat::ToText(void) for(int i=0; i