From 63ec13f022ae99c1664fbdbc9e6623903ba843af Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Wed, 15 Sep 2010 08:11:15 +0000 Subject: cli: add a simplistic option parser, convert "mode script" to "--mode=script" Signed-off-by: Csaba Henk Signed-off-by: Vijay Bellur BUG: 1570 (geosync related changes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570 --- libglusterfs/src/common-utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libglusterfs/src/common-utils.c') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index f3386fe2b62..022fdf35537 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -1548,3 +1548,16 @@ out: return ret; } + +char * +strtail (char *str, const char *pattern) +{ + int i = 0; + + for (i = 0; str[i] == pattern[i] && str[i]; i++); + + if (pattern[i] == '\0') + return str + i; + + return NULL; +} -- cgit