summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2021-09-03 16:51:47 +0000
committerschwarze <>2021-09-03 16:51:47 +0000
commit6a4f631c0b81b210fa815dc4488a2975b096f0df (patch)
tree7fa812036b6867037beec9ea40bf7b31f5244bf3
parent011462c41d571e7f77c0e6a58e14bcaa8d67ec00 (diff)
downloadopenbsd-6a4f631c0b81b210fa815dc4488a2975b096f0df.tar.gz
openbsd-6a4f631c0b81b210fa815dc4488a2975b096f0df.tar.bz2
openbsd-6a4f631c0b81b210fa815dc4488a2975b096f0df.zip
* add the missing STANDARDS section as noticed by tb@
* mention that the *optionp input string will be modified * clarify that the array of tokens is expected to be NULL-terminated OK millert@ tb@, and the first half of STANDARDS also OK jmc@
-rw-r--r--src/lib/libc/stdlib/getsubopt.323
1 files changed, 20 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/getsubopt.3 b/src/lib/libc/stdlib/getsubopt.3
index 335a4b9c07..e94e6395d2 100644
--- a/src/lib/libc/stdlib/getsubopt.3
+++ b/src/lib/libc/stdlib/getsubopt.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getsubopt.3,v 1.14 2014/11/15 14:41:02 bentley Exp $ 1.\" $OpenBSD: getsubopt.3,v 1.15 2021/09/03 16:51:47 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991, 1993 3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
29.\" 29.\"
30.\" @(#)getsubopt.3 8.1 (Berkeley) 6/9/93 30.\" @(#)getsubopt.3 8.1 (Berkeley) 6/9/93
31.\" 31.\"
32.Dd $Mdocdate: November 15 2014 $ 32.Dd $Mdocdate: September 3 2021 $
33.Dt GETSUBOPT 3 33.Dt GETSUBOPT 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
@@ -55,7 +55,9 @@ The argument
55is a pointer to a pointer to the string. 55is a pointer to a pointer to the string.
56The argument 56The argument
57.Fa tokens 57.Fa tokens
58is a pointer to a null-terminated array of pointers to strings. 58is a pointer to a
59.Dv NULL Ns -terminated
60array of pointers to strings.
59.Pp 61.Pp
60The 62The
61.Fn getsubopt 63.Fn getsubopt
@@ -79,6 +81,11 @@ On return from
79.Fa optionp 81.Fa optionp
80will be set to point to the start of the next token in the string, 82will be set to point to the start of the next token in the string,
81or the NUL at the end of the string if no more tokens are present. 83or the NUL at the end of the string if no more tokens are present.
84The comma, space, or tab character ending the token just parsed,
85and the equal sign separating name and value if any, are replaced
86with NUL bytes in the original
87.Pf * Fa optionp
88input string.
82The external variable 89The external variable
83.Fa suboptarg 90.Fa suboptarg
84will be set to point to the start of the current token, or 91will be set to point to the start of the current token, or
@@ -138,6 +145,16 @@ while ((ch = getopt(argc, argv, "ab:")) != -1) {
138.Sh SEE ALSO 145.Sh SEE ALSO
139.Xr getopt 3 , 146.Xr getopt 3 ,
140.Xr strsep 3 147.Xr strsep 3
148.Sh STANDARDS
149The
150.Fn getsubopt
151function conforms to
152.St -p1003.1-2008 .
153.Pp
154Allowing space and tab characters to separate tokens
155and the external variable
156.Va suboptarg
157are extensions to that standard.
141.Sh HISTORY 158.Sh HISTORY
142The 159The
143.Fn getsubopt 160.Fn getsubopt