--- src/lib/libc/stdlib/getopt.3 2003/06/17 04:26:46 1.2 +++ src/lib/libc/stdlib/getopt.3 2005/09/23 19:56:32 1.3 @@ -31,7 +31,7 @@ .\" .\" @(#)getopt.3 8.5 (Berkeley) 4/27/95 .\" $FreeBSD: src/lib/libc/stdlib/getopt.3,v 1.11.2.8 2001/12/14 18:33:58 ru Exp $ -.\" $DragonFly: src/lib/libc/stdlib/getopt.3,v 1.1 2003/06/16 04:34:58 dillon Exp $ +.\" $DragonFly$ .\" .Dd April 27, 1995 .Dt GETOPT 3 @@ -178,7 +178,7 @@ specification. int bflag, ch, fd; bflag = 0; -while ((ch = getopt(argc, argv, "bf:")) != -1) +while ((ch = getopt(argc, argv, "bf:")) != -1) { switch (ch) { case 'b': bflag = 1; @@ -187,10 +187,10 @@ while ((ch = getopt(argc, argv, "bf:")) if ((fd = open(optarg, O_RDONLY, 0)) < 0) err(1, "%s", optarg); break; - case '?': default: usage(); } +} argc -= optind; argv += optind; .Ed @@ -246,7 +246,7 @@ The following code fragment works in mos int length; char *p, *ep; -while ((ch = getopt(argc, argv, "0123456789")) != -1) +while ((ch = getopt(argc, argv, "0123456789")) != -1) { switch (ch) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -264,4 +264,5 @@ while ((ch = getopt(argc, argv, "0123456 errx(EX_USAGE, "illegal number -- %s", p); break; } +} .Ed