summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/common-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r--libglusterfs/src/common-utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 4eed92a92f9..ac0325f9d60 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -2069,6 +2069,23 @@ skipwhite (char **s)
(*s)++;
}
+void
+gf_strTrim (char **s)
+{
+ char *end = NULL;
+
+ end = *s + strlen(*s) - 1;
+ while (end > *s && isspace ((unsigned char)*end))
+ end--;
+
+ *(end+1) = '\0';
+
+ while (isspace (**s))
+ (*s)++;
+
+ return;
+}
+
char *
nwstrtail (char *str, char *pattern)
{