On Fri, Sep 16, 2016 at 12:50:39PM +0200, Erik Skultety wrote:
If the initial check is true the function immediately returns so
there's no
need to enclose the code following the check within an 'else' block.
Also, by removing the 'else' block, the declarations need to be moved to
beginning of the function block to conform with our guidelines.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
tools/vsh.c | 222 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 111 insertions(+), 111 deletions(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index 3772d92..4c63bd3 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -624,131 +624,131 @@ bool
vshCmddefHelp(vshControl *ctl, const char *cmdname)
{
const vshCmdDef *def = vshCmddefSearch(cmdname);
+ /* Don't translate desc if it is "". */
+ const char *desc = vshCmddefGetInfo(def, "desc");
+ const char *help = _(vshCmddefGetInfo(def, "help"));
This introduces a NULL defererence if the command does not exist.
ACK with that fixed.
Jan