aboutsummaryrefslogtreecommitdiffstats
path: root/util/stringhelp.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/stringhelp.c')
-rw-r--r--util/stringhelp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/util/stringhelp.c b/util/stringhelp.c
index 16908f9a3..32318dad3 100644
--- a/util/stringhelp.c
+++ b/util/stringhelp.c
@@ -103,6 +103,28 @@ trim_spaces( char *str )
return str ;
}
+/****************
+ * remove trailing white spaces
+ */
+char *
+trim_trailing_spaces( char *string )
+{
+ char *p, *mark;
+
+ for( mark = NULL, p = string; *p; p++ ) {
+ if( isspace( *(byte*)p ) ) {
+ if( !mark )
+ mark = p;
+ }
+ else
+ mark = NULL;
+ }
+ if( mark )
+ *mark = '\0' ;
+
+ return string ;
+}
+
unsigned