nsh_alias.c: unalias -a command does not work correctly
getopt returns the argument if it is found, so testing against != ERROR is wrong.
This commit is contained in:
parent
851a4aa904
commit
e9f4e87786
@ -408,7 +408,7 @@ int cmd_unalias(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
|
||||
/* If '-a' is provided, then just wipe them all */
|
||||
|
||||
if ((option = getopt(argc, argv, "a")) != ERROR)
|
||||
if ((option = getopt(argc, argv, "a")) == 'a')
|
||||
{
|
||||
alias_removeall(vtbl);
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user