提交 7fe613af 编写于 作者: J Jiri Denemark

vsh: Fix warnings in command line completer

GCC complained that

vsh.c: In function 'vshReadlineOptionsGenerator':
vsh.c:2622:29: warning: unused variable 'opt' [-Wunused-variable]
         const vshCmdOptDef *opt = &cmd->opts[list_index];
                             ^
vsh.c: In function 'vshReadlineParse':
vsh.c:2830:44: warning: 'opt' may be used uninitialized in this function
[-Wmaybe-uninitialized]
             completed_list = opt->completer(autoCompleteOpaque,
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 59539ebf
......@@ -2619,7 +2619,6 @@ vshReadlineOptionsGenerator(const char *text, int state, const vshCmdDef *cmd_pa
return NULL;
while ((name = cmd->opts[list_index].name)) {
const vshCmdOptDef *opt = &cmd->opts[list_index];
char *res;
list_index++;
......@@ -2648,7 +2647,7 @@ vshReadlineParse(const char *text, int state)
static vshCommandParser parser, sanitizer;
vshCommandToken tk;
static const vshCmdDef *cmd;
const vshCmdOptDef *opt;
const vshCmdOptDef *opt = NULL;
char *tkdata, *optstr, *const_tkdata, *completed_name;
char *res = NULL;
static char *ctext, *sanitized_text;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册