summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2012-11-27 15:13:15 +0530
committerAnand Avati <avati@redhat.com>2012-12-07 17:11:12 -0800
commitd0b0e59952222c186120c91518ccf94862a86f64 (patch)
treed9588e12a7f4fba7fc085c8af21b1c2b8e331418 /cli
parent66e34de1bef45dfd71ddccda57947fdb3c319640 (diff)
cli: cmd history echoes the last command string word twice with --mode=script
PROBLEM: When a gluster command is executed with --mode=script option enabled, the last word in the command string is echoed twice in command history. Example: [2012-12-03 05:29:16.083176] : volume start dis dis : SUCCESS FIX: Terminate argv with NULL when the words are shifted after omitting "--mode=script" from it. Change-Id: I3a2623efe02e58c97c34554988938a9299425492 BUG: 823081 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/4255 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/src/cli.c b/cli/src/cli.c
index 2b94df87cc4..a2457c2b6b1 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -382,6 +382,8 @@ parse_cmdline (int argc, char *argv[], struct cli_state *state)
}
}
+ state->argv[state->argc] = NULL;
+
return ret;
}