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:
parent
ec5079c9ff
commit
11617fe5ab
@ -134,7 +134,7 @@ int getopt(int argc, FAR char * const argv[], FAR const char *optstring)
|
|||||||
|
|
||||||
/* Verify input parameters. */
|
/* Verify input parameters. */
|
||||||
|
|
||||||
if (argv != NULL && optstring != NULL && argc > 1)
|
if (argv != NULL && optstring != NULL)
|
||||||
{
|
{
|
||||||
FAR char *optchar;
|
FAR char *optchar;
|
||||||
int noarg_ret = '?';
|
int noarg_ret = '?';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user