From 54a2e99c7b86cafa5ad350171f021589ef2a80df Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 11 Nov 2000 16:38:41 +0100 Subject: Implemented 'Commands' menu --- tools.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tools.c') diff --git a/tools.c b/tools.c index 4acea0b3..6d86f162 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)); -- cgit v1.2.3