mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 19:44:35 +08: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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user