diff options
author | Guido Falsi <madpilot@freebsd.org> | 2018-03-26 14:42:52 +0200 |
---|---|---|
committer | Guido Falsi <madpilot@freebsd.org> | 2018-03-26 06:50:54 -0600 |
commit | 48190c7f9310b047876c9d0c91d6a8b6dfcc6373 (patch) | |
tree | 8c759ea592603b61111df40b70517fb9ac4f7ccd | |
parent | 625d53a1296f4b1d12ed9160f9f7ff2503e389c0 (diff) |
core: fix getopt(3) usage
Setting optind = 0 is forced to 1 in glibc implementation, but
causes option parsing to be flawed in other implementations, for
example on FreeBSD.
ASTERISK-27773 #close
Change-Id: Ia548e69f8302e9754dbbedb6bc451c0700c66f61
-rw-r--r-- | main/asterisk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 36b1b54a1..2e80ffaf6 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -3963,7 +3963,7 @@ int main(int argc, char *argv[]) * * \todo Document these options */ - optind = 0; + optind = 1; while ((c = getopt(argc, argv, getopt_settings)) != -1) { /*!\note Please keep the ordering here to alphabetical, capital letters * first. This will make it easier in the future to select unused |