diff options
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r-- | libglusterfs/src/common-utils.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 6a5e2504b..1d0fb822f 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -1583,6 +1583,30 @@ strtail (char *str, const char *pattern) return NULL; } +void +skipwhite (char **s) +{ + while (isspace (**s)) + (*s)++; +} + +char * +nwstrtail (char *str, char *pattern) +{ + for (;;) { + skipwhite (&str); + skipwhite (&pattern); + + if (*str != *pattern || !*str) + break; + + str++; + pattern++; + } + + return *pattern ? NULL : str; +} + /* RFC 1123 & 952 */ char valid_host_name (char *address, int length) |