getopt(3) returns -1, not EOF.
This commit is contained in:
parent
3a4cc1b454
commit
5a57d3e796
@ -227,7 +227,7 @@ main(int ac, char *av[])
|
||||
|
||||
fp = stdout;
|
||||
|
||||
while ((x = getopt(ac, av, "do:")) != EOF) {
|
||||
while ((x = getopt(ac, av, "do:")) != -1) {
|
||||
switch(x) {
|
||||
case 'd':
|
||||
debug = 1;
|
||||
|
@ -70,7 +70,7 @@ DotCmd(int ac, char **av)
|
||||
|
||||
/* Get options */
|
||||
optind = 1;
|
||||
while ((ch = getopt(ac, av, "")) != EOF) {
|
||||
while ((ch = getopt(ac, av, "")) != -1) {
|
||||
switch (ch) {
|
||||
case '?':
|
||||
default:
|
||||
|
@ -73,7 +73,7 @@ ListCmd(int ac, char **av)
|
||||
|
||||
/* Get options */
|
||||
optind = 1;
|
||||
while ((ch = getopt(ac, av, "ln")) != EOF) {
|
||||
while ((ch = getopt(ac, av, "ln")) != -1) {
|
||||
switch (ch) {
|
||||
case 'l':
|
||||
list_hooks = 1;
|
||||
|
@ -147,7 +147,7 @@ main(int ac, char *av[])
|
||||
snprintf(name, sizeof(name), "ngctl%d", getpid());
|
||||
|
||||
/* Parse command line */
|
||||
while ((ch = getopt(ac, av, "df:n:")) != EOF) {
|
||||
while ((ch = getopt(ac, av, "df:n:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'd':
|
||||
NgSetDebug(NgSetDebug(-1) + 1);
|
||||
|
@ -70,7 +70,7 @@ ShowCmd(int ac, char **av)
|
||||
|
||||
/* Get options */
|
||||
optind = 1;
|
||||
while ((ch = getopt(ac, av, "n")) != EOF) {
|
||||
while ((ch = getopt(ac, av, "n")) != -1) {
|
||||
switch (ch) {
|
||||
case 'n':
|
||||
no_hooks = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user