mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue