Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element.
Callers store zero here to inhibit the error message for unrecognized options.
This must be initialized on some systems to avoid linking in the system's own getopt implementation. This is what Unix does. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble.