always use getopt(3)
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 15 Mar 1991 05:42:12 +0000 (21:42 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 15 Mar 1991 05:42:12 +0000 (21:42 -0800)
SCCS-vsn: usr.bin/passwd/passwd.c 5.4

usr/src/usr.bin/passwd/passwd.c

index f203d05..afdf023 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)passwd.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)passwd.c   5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <stdio.h>
 #endif /* not lint */
 
 #include <stdio.h>
@@ -36,6 +36,10 @@ main(argc, argv)
                case 'l':               /* change local password file */
                        use_kerberos = 0;
                        break;
                case 'l':               /* change local password file */
                        use_kerberos = 0;
                        break;
+#else
+       while ((ch = getopt(argc, argv, "")) != EOF)
+               switch (ch) {
+#endif
                default:
                case '?':
                        usage();
                default:
                case '?':
                        usage();
@@ -44,7 +48,6 @@ main(argc, argv)
 
        argc -= optind;
        argv += optind;
 
        argc -= optind;
        argv += optind;
-#endif
 
        uname = getlogin();
 
 
        uname = getlogin();