diff options
| author | Robert Nordier <rnordier@FreeBSD.org> | 1998-05-04 23:16:50 +0000 |
|---|---|---|
| committer | Robert Nordier <rnordier@FreeBSD.org> | 1998-05-04 23:16:50 +0000 |
| commit | a55fccb45639066a59328b8db2128d354ea96e3b (patch) | |
| tree | fc6642d36a2b59c3ea7600e7a4e0d0cbbe174d4e /lib/libc/stdlib | |
| parent | 1879eba7ea63322c8b558924da14bacdc269e62a (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib')
| -rw-r--r-- | lib/libc/stdlib/getopt.3 | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libc/stdlib/getopt.3 b/lib/libc/stdlib/getopt.3 index 4be47a9bd8cf..595e3f37b66d 100644 --- a/lib/libc/stdlib/getopt.3 +++ b/lib/libc/stdlib/getopt.3 @@ -130,7 +130,7 @@ by the option .Ql -- (double dash) which causes .Fn getopt -to signal the end of argument processing and returns \-1. +to signal the end of argument processing and return \-1. When all options have been processed (i.e., up to the first non-option argument), .Fn getopt @@ -177,7 +177,7 @@ int bflag, ch, fd; bflag = 0; while ((ch = getopt(argc, argv, "bf:")) != -1) - switch(ch) { + switch (ch) { case 'b': bflag = 1; break; @@ -247,8 +247,8 @@ The following code fragment works in most cases. int length; char *p; -while ((c = getopt(argc, argv, "0123456789")) != -1) - switch (c) { +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': p = argv[optind - 1]; @@ -258,5 +258,4 @@ while ((c = getopt(argc, argv, "0123456789")) != -1) length = atoi(argv[optind] + 1); break; } -} .Ed |
