From: Theodore Tso Date: Wed, 6 May 1998 18:58:24 +0000 (+0000) Subject: POSIX states that getopt returns -1 when it is done parsing options, X-Git-Tag: krb5-1.1-beta1~739 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3cf5237f30cf37b7bc236e84274edbbbe2997766;p=krb5.git POSIX states that getopt returns -1 when it is done parsing options, not EOF. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10547 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 3f9dbfdfc..616a207ed 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,10 @@ +1998-05-06 Theodore Ts'o + + * login.c (main): + * krshd.c (main): + * krlogind.c (main): POSIX states that getopt returns -1 when it + is done parsing options, not EOF. + Sat Feb 28 10:44:46 1998 Theodore Ts'o * configure.in: Clean up configure script. Check $cross_compiling diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index b24fa445e..bd376ff09 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -341,7 +341,7 @@ int main(argc, argv) /* Analyse parameters. */ opterr = 0; - while ((ch = getopt(argc, argv, ARGSTR)) != EOF) + while ((ch = getopt(argc, argv, ARGSTR)) != -1) switch (ch) { #ifdef KERBEROS case 'k': diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index 71cadcc7f..164dd6d55 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -281,7 +281,7 @@ int main(argc, argv) /* Analyze parameters. */ opterr = 0; - while ((ch = getopt(argc, argv, ARGSTR)) != EOF) + while ((ch = getopt(argc, argv, ARGSTR)) != -1) switch (ch) { #ifdef KERBEROS case 'k': diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index f593c5312..af9d5ccbc 100644 --- a/src/appl/bsd/login.c +++ b/src/appl/bsd/login.c @@ -1213,7 +1213,7 @@ int rewrite_ccache = 1; /*try to write out ccache*/ fflag = hflag = pflag = rflag = kflag = Kflag = eflag = 0; passwd_req = 1; - while ((ch = getopt(argc, argv, "Ffeh:pr:k:K:")) != EOF) + while ((ch = getopt(argc, argv, "Ffeh:pr:k:K:")) != -1) switch (ch) { case 'f': EXCL_AUTH_TEST;