Gregory Nutt af3c76bb53 Correct some getopt() logic
1. Null pointer dereference:

-  for (ndx = 0; longopts[ndx].name[0] != '\0'; ndx++)
+  for (ndx = 0; longopts[ndx].name != NULL; ndx++)

2. Handle single character long options.  An option like -x could be either a short option or a long option (under getopt_long_only()).  This case was not being handled correctly.

3. Add missing support for optional arguments to short options (indicated with two "::"

This effects all members of the getopt() family of APIs.

Tested on the simulator using extensions to apps/testing/ostest.
2021-04-02 21:31:02 +01:00
..
2021-03-03 18:52:53 -08:00
2021-03-03 18:52:53 -08:00
2021-03-02 03:44:06 -08:00
2021-03-02 03:44:06 -08:00
2021-03-02 03:44:06 -08:00
2020-05-01 10:43:47 -03:00
2021-03-02 03:44:06 -08:00
2021-03-02 03:44:06 -08:00
2021-03-02 03:44:06 -08:00
2021-03-03 18:52:53 -08:00