summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2011-04-21 17:38:10 +0000
committerAnand Avati <avati@gluster.com>2011-04-22 04:05:20 -0700
commit625f779dba824d40626473cd85aaacdefbfae1ce (patch)
treeb35b1ec3e4529734c6b74531d918f903c88bc93f
parent775323c1b2fa9a557d3ea74d57e843575f7b1278 (diff)
cli: fix up parsing of geo-replication statusv3.2.0qa16
Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2785 (gsyncd logs on slave side go to /dev/null) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2785
-rw-r--r--cli/src/cli-cmd-parser.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 2954609b76a..735dcb02bc4 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1168,15 +1168,18 @@ cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **options)
cmdi = slavei + 1;
if (slavei == 3)
masteri = 2;
- } else if (i == 2) {
+ } else if (i <= 3) {
/* no $s, can only be status cmd
- * (with either a single $m before it or nothing;
- * i remaining 2 is a good check for this condition)
+ * (with either a single $m before it or nothing)
+ * -- these conditions imply that i <= 3 after
+ * the iteration and that i is the successor of
+ * the (0 or 1 length) sequence of $m-s.
*/
- cmdi = wordcount - 1;
- if (i < cmdi)
- masteri = i;
- }
+ cmdi = i;
+ if (i == 3)
+ masteri = 2;
+ } else
+ goto out;
/* now check if input really complies syntax
* (in a somewhat redundant way, in favor