mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
unistd/getopt: remove count of arguments
N/A For commands without "-" arguments, ex:"ls", we should always let optind = 1 after getopt is called in order to get what follows correctly. Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com> Change-Id: Iac3cfbadd27fb96e47070c4e3198229306299b6b
This commit is contained in:
@@ -134,7 +134,7 @@ int getopt(int argc, FAR char * const argv[], FAR const char *optstring)
|
||||
|
||||
/* Verify input parameters. */
|
||||
|
||||
if (argv != NULL && optstring != NULL && argc > 1)
|
||||
if (argv != NULL && optstring != NULL)
|
||||
{
|
||||
FAR char *optchar;
|
||||
int noarg_ret = '?';
|
||||
|
||||
Reference in New Issue
Block a user