summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-parser.c
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2010-10-09 06:58:00 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-09 06:45:33 -0700
commit2eb9861cbc0387b1054bfeb7864c255a42b475f5 (patch)
tree3b06d67d794d798ce852566d3e6a7efe9a83781d /cli/src/cli-cmd-parser.c
parentafb6997fe74af257c7e687e33fe88a292f7a4a00 (diff)
mgmt/Glusterd: Memory leak fixes, minor CLI changesv3.1.0qa44
Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1852 (Usage message of volume set printed twice) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1852
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r--cli/src/cli-cmd-parser.c8
1 files changed, 4 insertions, 4 deletions
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 <VOLNAME> <KEY> <VALUE>");
goto out;
}