getopt(3) returns -1, not EOF.

This commit is contained in:
Ruslan Ermilov 2008-02-19 07:09:19 +00:00
parent 58eefce0e6
commit b7498df286
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176407
9 changed files with 9 additions and 9 deletions

View File

@ -270,7 +270,7 @@ char **argv;
{
int ch;
while ((ch = getopt(argc, argv, "Cc:iorsx")) != EOF)
while ((ch = getopt(argc, argv, "Cc:iorsx")) != -1)
switch(ch) {
case 'C': /* embedded comments */
Cflag++;

View File

@ -324,7 +324,7 @@ man_getopt (argc, argv)
extern void downcase ();
extern char *manpath ();
while ((c = getopt (argc, argv, args)) != EOF)
while ((c = getopt (argc, argv, args)) != -1)
{
switch (c)
{

View File

@ -78,7 +78,7 @@ main(argc, argv)
prognam = mkprogname (argv[0]);
while ((c = getopt (argc, argv, "dhLq?")) != EOF)
while ((c = getopt (argc, argv, "dhLq?")) != -1)
{
switch (c)
{

View File

@ -1037,7 +1037,7 @@ main (int argc, char **argv)
for (;;) {
switch (getopt (argc, argv, "mseftucviax")) {
case EOF:
case -1:
break;
case 'a':
++aflag;

View File

@ -179,7 +179,7 @@ main(int argc, char *argv[])
/* process the argument list */
kflag = 0;
while ((i = getopt(argc, argv, "abdF:f:k:m:o:pv:")) != EOF)
while ((i = getopt(argc, argv, "abdF:f:k:m:o:pv:")) != -1)
switch(i) {
case 'a': /* key is ASCII */
keybase = KEY_ASCII;

View File

@ -942,7 +942,7 @@ main(int argc, char **argv)
setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */
while ((ch = getopt(argc, argv, "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:W"))
!= EOF)
!= -1)
switch (ch) {
case 'b':
simulatedopcount = getnum(optarg, &endp);

View File

@ -110,7 +110,7 @@ logout(int argc, char *argv[], struct ncp_conn_loginfo *li) {
int error = 0, connid, opt;
connid = -1;
while ((opt = getopt(argc, argv, STDPARAM_OPT"c:")) != EOF){
while ((opt = getopt(argc, argv, STDPARAM_OPT"c:")) != -1){
switch (opt) {
case 'c':
connid = atoi(optarg);

View File

@ -190,7 +190,7 @@ int main (int argc, char **argv)
for (;;) {
switch (getopt (argc, argv, "svhf:")) {
case EOF:
case -1:
break;
case 's':
verbose = 0;

View File

@ -170,7 +170,7 @@ char * argv[];
if (c == 'v')
vflag = 1;
else cutoff = optarg;
if ((c != EOF && c != -1) ||
if ((c != -1) ||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
usage();
}