Fix nsh_action CLI issue 28/3928/2
authorHongjun Ni <[email protected]>
Wed, 23 Nov 2016 14:20:06 +0000 (22:20 +0800)
committerHongjun Ni <[email protected]>
Wed, 23 Nov 2016 08:21:57 +0000 (08:21 +0000)
rebuild

Change-Id: I5d823724186bdc31b15e4739f9f33f0a29d87fbe
Signed-off-by: Hongjun Ni <[email protected]>
nsh-plugin/nsh/nsh.c

index ae440b8..924eda2 100644 (file)
@@ -311,14 +311,15 @@ static uword unformat_nsh_action (unformat_input_t * input, va_list * args)
 
   if (unformat (input, "swap"))
     *result = NSH_ACTION_SWAP;
-  if (unformat (input, "push"))
+  else if (unformat (input, "push"))
     *result = NSH_ACTION_PUSH;
-  if (unformat (input, "pop"))
+  else if (unformat (input, "pop"))
     *result = NSH_ACTION_POP;
   else if (unformat (input, "%d", &tmp))
     *result = tmp;
   else
     return 0;
+
   return 1;
 }