From f35a3f07ec8833eac074dcca46cdffc7fd1f2efe Mon Sep 17 00:00:00 2001 From: rnordier Date: Mon, 4 May 1998 23:16:50 +0000 Subject: Fix a few nits in quoted code fragments and elsewhere. --- lib/libc/stdlib/getopt.3 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/stdlib/getopt.3 b/lib/libc/stdlib/getopt.3 index 4be47a9..595e3f3 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 -- cgit v1.1