aboutsummaryrefslogtreecommitdiffstats
path: root/nsh-plugin
diff options
context:
space:
mode:
authorHongjun Ni <hongjun.ni@intel.com>2016-11-23 22:20:06 +0800
committerHongjun Ni <hongjun.ni@intel.com>2016-11-23 08:21:57 +0000
commit738555ab3c6e6f6a2b00dfcba5c437a6c7f949dc (patch)
treea6fc8713dc89b0cf05991b6df045cca274e48173 /nsh-plugin
parent37a5ce7bdcc9bfc39d3ebabcfbdc4f4ffad3b7f0 (diff)
Fix nsh_action CLI issue
rebuild Change-Id: I5d823724186bdc31b15e4739f9f33f0a29d87fbe Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
Diffstat (limited to 'nsh-plugin')
-rw-r--r--nsh-plugin/nsh/nsh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nsh-plugin/nsh/nsh.c b/nsh-plugin/nsh/nsh.c
index ae440b8..924eda2 100644
--- a/nsh-plugin/nsh/nsh.c
+++ b/nsh-plugin/nsh/nsh.c
@@ -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;
}