summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-01-19 20:38:28 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2021-01-19 20:38:28 +0100
commitad35c9c2d331e8c87886ce559fe838b5ac60776b (patch)
tree2858d674e76de6771b457b84c51694be514621b4 /tools.c
parent1b1465a6775c1f53d1f7ef5ef13c7efdbc42a74a (diff)
downloadvdr-ad35c9c2d331e8c87886ce559fe838b5ac60776b.tar.gz
vdr-ad35c9c2d331e8c87886ce559fe838b5ac60776b.tar.bz2
Added some missing user command calls for copying, renaming and moving recordings
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 88bfad32..ed0589cb 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 5.2 2020/12/29 21:40:29 kls Exp $
+ * $Id: tools.c 5.3 2021/01/19 20:38:28 kls Exp $
*/
#include "tools.h"
@@ -200,6 +200,16 @@ int strcountchr(const char *s, char c)
return n;
}
+cString strgetbefore(const char *s, char c, int n)
+{
+ const char *p = strrchr(s, 0); // points to the terminating 0 of s
+ while (--p >= s) {
+ if (*p == c && --n == 0)
+ break;
+ }
+ return cString(s, p);
+}
+
const char *strgetlast(const char *s, char c)
{
const char *p = strrchr(s, c);