summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-01-20 16:47:09 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-01-20 16:47:09 +0100
commit305abd449f33d3885d2167c05f33d3144ee05d15 (patch)
tree4540162e082ea1224d2c3a9d2ef1e2b6476aa496 /tools.c
parentfd839aae7b0a443db6f0eab59fcc93f03aafd0ba (diff)
downloadvdr-305abd449f33d3885d2167c05f33d3144ee05d15.tar.gz
vdr-305abd449f33d3885d2167c05f33d3144ee05d15.tar.bz2
Now using 'ftw()' instead of an external 'find' to collect recordings
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 472c50d7..de21af50 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 1.50 2001/10/19 13:12:45 kls Exp $
+ * $Id: tools.c 1.51 2002/01/20 15:43:35 kls Exp $
*/
#include "tools.h"
@@ -145,6 +145,17 @@ bool startswith(const char *s, const char *p)
return true;
}
+bool endswith(const char *s, const char *p)
+{
+ const char *se = s + strlen(s) - 1;
+ const char *pe = p + strlen(p) - 1;
+ while (pe >= p) {
+ if (*pe-- != *se-- || (se < s && pe >= p))
+ return false;
+ }
+ return true;
+}
+
bool isempty(const char *s)
{
return !(s && *skipspace(s));