mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
59539ebff3
commit
7fe613af57
@ -2619,7 +2619,6 @@ vshReadlineOptionsGenerator(const char *text, int state, const vshCmdDef *cmd_pa
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while ((name = cmd->opts[list_index].name)) {
|
while ((name = cmd->opts[list_index].name)) {
|
||||||
const vshCmdOptDef *opt = &cmd->opts[list_index];
|
|
||||||
char *res;
|
char *res;
|
||||||
|
|
||||||
list_index++;
|
list_index++;
|
||||||
@ -2648,7 +2647,7 @@ vshReadlineParse(const char *text, int state)
|
|||||||
static vshCommandParser parser, sanitizer;
|
static vshCommandParser parser, sanitizer;
|
||||||
vshCommandToken tk;
|
vshCommandToken tk;
|
||||||
static const vshCmdDef *cmd;
|
static const vshCmdDef *cmd;
|
||||||
const vshCmdOptDef *opt;
|
const vshCmdOptDef *opt = NULL;
|
||||||
char *tkdata, *optstr, *const_tkdata, *completed_name;
|
char *tkdata, *optstr, *const_tkdata, *completed_name;
|
||||||
char *res = NULL;
|
char *res = NULL;
|
||||||
static char *ctext, *sanitized_text;
|
static char *ctext, *sanitized_text;
|
||||||
|
Loading…
Reference in New Issue
Block a user