From 2eb9861cbc0387b1054bfeb7864c255a42b475f5 Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Sat, 9 Oct 2010 06:58:00 +0000 Subject: mgmt/Glusterd: Memory leak fixes, minor CLI changes Signed-off-by: Kaushik BV Signed-off-by: Vijay Bellur BUG: 1852 (Usage message of volume set printed twice) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1852 --- cli/src/cli-cmd-parser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 7d3fa84d87c..1381e0fecef 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -355,7 +355,7 @@ cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options) if (!dict) goto out; - if (wordcount < 3) + if (wordcount < 4) goto out; volname = (char *)words[2]; @@ -367,11 +367,12 @@ cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options) if (ret) goto out; + for (i = 3; i < wordcount; i+=2) { key = (char *) words[i]; value = (char *) words[i+1]; - + if ( key && !value ) { if ( !strcmp (key, "history")) { ret = dict_set_str (dict, key, "history"); @@ -384,10 +385,9 @@ cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options) goto out; } } - + if ( !key || !value) { ret = -1; - cli_out ("Usage: volume set "); goto out; } -- cgit