summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsyn <>2003-04-10 17:05:08 +0000
committerjsyn <>2003-04-10 17:05:08 +0000
commitcf02c1b97c52563ce942033a929c6500747c07cd (patch)
tree4f58b7845756198191cb6d67f5e8a014b9923382 /src
parent873608ca11b3956ba42272e7fda34b0187999d30 (diff)
downloadopenbsd-cf02c1b97c52563ce942033a929c6500747c07cd.tar.gz
openbsd-cf02c1b97c52563ce942033a929c6500747c07cd.tar.bz2
openbsd-cf02c1b97c52563ce942033a929c6500747c07cd.zip
make the second example valid; ok millert@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/stdlib/getopt.37
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3
index 7173b62c5c..e16a11dfee 100644
--- a/src/lib/libc/stdlib/getopt.3
+++ b/src/lib/libc/stdlib/getopt.3
@@ -29,7 +29,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: getopt.3,v 1.20 2002/12/08 18:12:50 millert Exp $ 32.\" $OpenBSD: getopt.3,v 1.21 2003/04/10 17:05:08 jsyn Exp $
33.\" 33.\"
34.Dd December 8, 2002 34.Dd December 8, 2002
35.Dt GETOPT 3 35.Dt GETOPT 3
@@ -270,11 +270,12 @@ It is provided for backward compatibility
270.Em only . 270.Em only .
271The following code fragment works in most cases. 271The following code fragment works in most cases.
272.Bd -literal -offset indent 272.Bd -literal -offset indent
273int ch;
273long length; 274long length;
274char *p; 275char *p;
275 276
276while ((c = getopt(argc, argv, "0123456789")) != -1) { 277while ((ch = getopt(argc, argv, "0123456789")) != -1) {
277 switch (c) { 278 switch (ch) {
278 case '0': case '1': case '2': case '3': case '4': 279 case '0': case '1': case '2': case '3': case '4':
279 case '5': case '6': case '7': case '8': case '9': 280 case '5': case '6': case '7': case '8': case '9':
280 p = argv[optind - 1]; 281 p = argv[optind - 1];