summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 4acea0b..6d86f16 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.22 2000/10/29 11:21:55 kls Exp $
+ * $Id: tools.c 1.23 2000/11/11 15:17:12 kls Exp $
*/
#define _GNU_SOURCE
@@ -92,6 +92,18 @@ char *skipspace(const char *s)
return (char *)s;
}
+char *stripspace(char *s)
+{
+ if (s && *s) {
+ for (char *p = s + strlen(s) - 1; p >= s; p--) {
+ if (!isspace(*p))
+ break;
+ *p = 0;
+ }
+ }
+ return s;
+}
+
bool isempty(const char *s)
{
return !(s && *skipspace(s));