From 8578af36682c104c3ef99e1d7cdc77d3abaa5444 Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 23 Jul 2013 18:50:33 +0200 Subject: [PATCH] Fixed a bug when epgsearch search string contains a colon --- recmanager.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/recmanager.c b/recmanager.c index 59eddcb..61ad426 100644 --- a/recmanager.c +++ b/recmanager.c @@ -386,14 +386,18 @@ std::vector cRecManager::ReadEPGSearchTemplates(void) } std::string cRecManager::BuildEPGSearchString(cString searchString, std::string templValue) { + std::string strSearchString = *searchString; + std::replace(strSearchString.begin(), strSearchString.end(), ':', '|'); std::stringstream searchTimerString; searchTimerString << "0:"; - searchTimerString << *searchString; + searchTimerString << strSearchString; searchTimerString << templValue; return searchTimerString.str(); } std::string cRecManager::BuildEPGSearchString(cString searchString, cRecMenu *menu) { + std::string strSearchString = *searchString; + std::replace(strSearchString.begin(), strSearchString.end(), ':', '|'); int searchMode = menu->GetIntValue(0); bool useTitle = menu->GetBoolValue(1); bool useSubTitle = menu->GetBoolValue(2); @@ -417,7 +421,7 @@ std::string cRecManager::BuildEPGSearchString(cString searchString, cRecMenu *me //1 - unique search timer id searchTimerString << "0:"; //2 - the search term - searchTimerString << *searchString; + searchTimerString << strSearchString; //3 - use time? 0/1 //4 - start time in HHMM //5 - stop time in HHMM @@ -538,7 +542,7 @@ std::string cRecManager::BuildEPGSearchString(cString searchString, cRecMenu *me 54 - compare date when testing for a repeat? (0=no, 1=same day, 2=same week, 3=same month) */ searchTimerString << "0::::0:::0::0:::::::::0"; - //esyslog("tvguide: epgsearch String: %s", searchTimerString.str().c_str()); + esyslog("tvguide: epgsearch String: %s", searchTimerString.str().c_str()); return searchTimerString.str(); } @@ -609,6 +613,8 @@ const cEvent **cRecManager::PerformSearch(cRecMenu *menu, bool withOptions, int if (epgSearchPlugin->Service("Epgsearch-searchresults-v1.0", &data)) { cList *list = data.pResultList; + if (!list) + return NULL; int numElements = list->Count(); const cEvent **searchResults = NULL; if (numElements > 0) {