Formerly main.c.~42~

This commit is contained in:
Roland McGrath 1992-05-11 18:11:40 +00:00
parent 81db471695
commit cfe0c54e8c

13
main.c
View file

@ -1037,7 +1037,8 @@ decode_switches (argc, argv)
*p++ = '-'; /* Non-option args are returned in order. */ *p++ = '-'; /* Non-option args are returned in order. */
for (i = 0; switches[i].c != '\0'; ++i) for (i = 0; switches[i].c != '\0'; ++i)
{ {
long_options[i].name = switches[i].long_name; long_options[i].name = (switches[i].long_name == 0 ? "" :
switches[i].long_name);
*p++ = switches[i].c; *p++ = switches[i].c;
switch (switches[i].type) switch (switches[i].type)
{ {
@ -1091,8 +1092,8 @@ decode_switches (argc, argv)
} }
else else
for (cs = switches; cs->c != '\0'; ++cs) for (cs = switches; cs->c != '\0'; ++cs)
{ if (cs->c == c)
if (cs->c == c) {
switch (cs->type) switch (cs->type)
{ {
default: default:
@ -1158,9 +1159,9 @@ positive integral argument",
break; break;
} }
/* We've found the switch. Stop looking. */ /* We've found the switch. Stop looking. */
break; break;
} }
} }
if (other_args != 0) if (other_args != 0)