diff options
author | 2002-12-08 18:12:50 +0000 | |
---|---|---|
committer | 2002-12-08 18:12:50 +0000 | |
commit | 19e512382a70e6f199a5c751f3e76e03b0d86712 (patch) | |
tree | 302082c2283c38dbab90b6e7b8b44683a14f3e49 /lib/libc/stdlib/getopt.3 | |
parent | SUS (and apparently 1003.1-2001) say to check optstring for NULL (diff) | |
download | wireguard-openbsd-19e512382a70e6f199a5c751f3e76e03b0d86712.tar.xz wireguard-openbsd-19e512382a70e6f199a5c751f3e76e03b0d86712.zip |
In BUGS section, append a warning to not use '-' as the first character
of optstring to avoid a semantic conflict with GNU getopt.
Diffstat (limited to 'lib/libc/stdlib/getopt.3')
-rw-r--r-- | lib/libc/stdlib/getopt.3 | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/libc/stdlib/getopt.3 b/lib/libc/stdlib/getopt.3 index 0a28fa9e604..7173b62c5c5 100644 --- a/lib/libc/stdlib/getopt.3 +++ b/lib/libc/stdlib/getopt.3 @@ -29,9 +29,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: getopt.3,v 1.19 2002/12/04 21:42:22 millert Exp $ +.\" $OpenBSD: getopt.3,v 1.20 2002/12/08 18:12:50 millert Exp $ .\" -.Dd April 19, 1994 +.Dd December 8, 2002 .Dt GETOPT 3 .Os .Sh NAME @@ -244,10 +244,20 @@ as an option flag. This practice is wrong, and should not be used in any current development. It is provided for backward compatibility .Em only . +Care should be taken to not to use +.Ql - +as the first character in +.Fa optstring +to avoid a semantic conflict with +.Tn GNU +.Fn getopt , +which assigns different meaning to an +.Fa optstring +that begins with a +.Ql - . By default, a single dash causes .Fn getopt to return \-1. -This is, we believe, compatible with System V. .Pp It is also possible to handle digits as option letters. This allows |