From 40ca081ff4e360c383a66c627df4c467c04e5913 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 1 Jan 2021 15:26:27 +0100 Subject: Using strgetlast() in more places --- recording.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'recording.c') diff --git a/recording.c b/recording.c index 17467e36..2e2ceefa 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 5.1 2020/12/26 15:49:01 kls Exp $ + * $Id: recording.c 5.2 2021/01/01 15:26:27 kls Exp $ */ #include "recording.h" @@ -1050,9 +1050,7 @@ cString cRecording::Folder(void) const cString cRecording::BaseName(void) const { - if (char *s = strrchr(name, FOLDERDELIMCHAR)) - return cString(s + 1); - return name; + return strgetlast(name, FOLDERDELIMCHAR); } const char *cRecording::FileName(void) const @@ -1158,8 +1156,7 @@ int cRecording::HierarchyLevels(void) const bool cRecording::IsEdited(void) const { - const char *s = strrchr(name, FOLDERDELIMCHAR); - s = !s ? name : s + 1; + const char *s = strgetlast(name, FOLDERDELIMCHAR); return *s == '%'; } -- cgit v1.2.3