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:
dongjiuzhu
2020-12-01 11:20:54 +08:00
parent 4a0f96fd4f
commit 93b3c7a34d
+1 -1
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 = '?';