unistd/getopt: remove count of arguments limits

For commands without "-" arguments, ex:"ls", we should always let
optind = 1 after getopt is called in order to get what follows
correctly.

Change-Id: Iac3cfbadd27fb96e47070c4e3198229306299b6b
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu 2020-12-01 11:20:54 +08:00 committed by Xiang Xiao
parent ec5079c9ff
commit 11617fe5ab

View File

@ -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 = '?';