summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-08-17 13:19:10 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-08-17 13:19:10 +0200
commite994e3a4fef46bcd17aae84f04b552d2b32f7469 (patch)
tree230051f12a02b0f845159193bb5839a1a9649bd9 /tools.c
parent716d3d07b485cadb5e60f40f3b408d533cef190e (diff)
downloadvdr-e994e3a4fef46bcd17aae84f04b552d2b32f7469.tar.gz
vdr-e994e3a4fef46bcd17aae84f04b552d2b32f7469.tar.bz2
Implemented EPG bugfixing
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index e6aba17a..30b675b2 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.39 2001/08/12 15:12:54 kls Exp $
+ * $Id: tools.c 1.40 2001/08/17 12:45:42 kls Exp $
*/
#define _GNU_SOURCE
@@ -103,6 +103,32 @@ char *stripspace(char *s)
return s;
}
+char *compactspace(char *s)
+{
+ if (s && *s) {
+ char *t = stripspace(skipspace(s));
+ char *p = t;
+ while (p && *p) {
+ char *q = skipspace(p);
+ if (q - p > 1)
+ memmove(p + 1, q, strlen(q) + 1);
+ p++;
+ }
+ if (t != s)
+ memmove(s, t, strlen(t) + 1);
+ }
+ return s;
+}
+
+bool startswith(const char *s, const char *p)
+{
+ while (*p) {
+ if (*p++ != *s++)
+ return false;
+ }
+ return true;
+}
+
bool isempty(const char *s)
{
return !(s && *skipspace(s));