Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The GNU implementation of `getopt` permute the contents of argv as it scans, so that eventually all the nonoptions are at the end. This doesn't happen in FreeBSD and in MacOSX, where the BSD implementation is used. This behaviour of the GNU implementation of `getopt` was hiding a bug since the `optind` was initialized to zero, causing the first string of argv (the executable name) to be interpreted as the name of the file to edit. By default `optind` is initialized to `1` by the system (see [1] for more info and for a better explanation of the issue). [1]: https://linux.die.net/man/3/getopt
- Loading branch information