summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-01-01 15:26:27 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2021-01-01 15:26:27 +0100
commit40ca081ff4e360c383a66c627df4c467c04e5913 (patch)
treeb2fe747fd8319176397ec4afb844f9631690f474 /menu.c
parentc46fd1ff5bbddbe7b66c6a362d493d4fcb338c10 (diff)
downloadvdr-40ca081ff4e360c383a66c627df4c467c04e5913.tar.gz
vdr-40ca081ff4e360c383a66c627df4c467c04e5913.tar.bz2
Using strgetlast() in more places
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/menu.c b/menu.c
index 5c6e4832..4b2815ec 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 5.1 2020/12/26 15:49:01 kls Exp $
+ * $Id: menu.c 5.2 2021/01/01 15:26:27 kls Exp $
*/
#include "menu.h"
@@ -1094,11 +1094,7 @@ void cMenuEditTimer::SetPatternItem(bool Initial)
return;
}
if (!*data.pattern) {
- char *p = strrchr(data.file, FOLDERDELIMCHAR);
- if (p)
- p++;
- else
- p = data.file;
+ char *p = strgetlast(data.file, FOLDERDELIMCHAR);
strn0cpy(data.pattern, p, sizeof(data.pattern));
}
Ins(pattern = new cMenuEditStrItem( tr("Pattern"), data.pattern, sizeof(data.pattern)), true, file);
@@ -1120,11 +1116,7 @@ eOSState cMenuEditTimer::SetFolder(void)
{
if (cMenuFolder *mf = dynamic_cast<cMenuFolder *>(SubMenu())) {
cString Folder = mf->GetFolder();
- char *p = strrchr(data.file, FOLDERDELIMCHAR);
- if (p)
- p++;
- else
- p = data.file;
+ char *p = strgetlast(data.file, FOLDERDELIMCHAR);
if (!isempty(*Folder))
strn0cpy(data.file, cString::sprintf("%s%c%s", *Folder, FOLDERDELIMCHAR, p), sizeof(data.file));
else if (p != data.file)