diff options
Diffstat (limited to 'libcore')
-rw-r--r-- | libcore/helpers.c | 1 | ||||
-rw-r--r-- | libcore/recfolderinfo.c | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/libcore/helpers.c b/libcore/helpers.c index f24f6e7..c8e7fe2 100644 --- a/libcore/helpers.c +++ b/libcore/helpers.c @@ -138,7 +138,6 @@ string &trim(string &s) { return ltrim(rtrim(s)); } - // split: receives a char delimiter; returns a vector of strings // By default ignores repeated delimiters, unless argument rep == 1. vector<string>& splitstring::split(char delim, int rep) { diff --git a/libcore/recfolderinfo.c b/libcore/recfolderinfo.c index 87dba4a..db4470d 100644 --- a/libcore/recfolderinfo.c +++ b/libcore/recfolderinfo.c @@ -66,16 +66,20 @@ void cRecordingsFolderInfo::Rebuild(void) // re-get state with lock held _recordings.StateChanged(_recState); cFolderInfoIntern *info; + cString folder; for (cRecording *rec = _recordings.First(); rec; rec = _recordings.Next(rec)) { +#if APIVERSNUM < 20102 //cRecording::Folder() first available since VDR 2.1.2 - cString folder(""); - char *folderName = strdup(rec->Name()); - if (char *s = strrchr(folderName, FOLDERDELIMCHAR)) - folder = cString(folderName, s); + const char *recName = rec->Name(); + if (const char *s = strrchr(recName, FOLDERDELIMCHAR)) + folder = cString(recName, s); + else + folder = ""; +#else + folder = rec->Folder(); +#endif info = _root->Find(*folder, true); - //info = _root->Find(*rec->Folder(), true); info->Add(rec); - free(folderName); } } |