diff options
author | schwarze <> | 2021-09-03 16:51:47 +0000 |
---|---|---|
committer | schwarze <> | 2021-09-03 16:51:47 +0000 |
commit | 6a4f631c0b81b210fa815dc4488a2975b096f0df (patch) | |
tree | 7fa812036b6867037beec9ea40bf7b31f5244bf3 | |
parent | 011462c41d571e7f77c0e6a58e14bcaa8d67ec00 (diff) | |
download | openbsd-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.3 | 23 |
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 | |||
55 | is a pointer to a pointer to the string. | 55 | is a pointer to a pointer to the string. |
56 | The argument | 56 | The argument |
57 | .Fa tokens | 57 | .Fa tokens |
58 | is a pointer to a null-terminated array of pointers to strings. | 58 | is a pointer to a |
59 | .Dv NULL Ns -terminated | ||
60 | array of pointers to strings. | ||
59 | .Pp | 61 | .Pp |
60 | The | 62 | The |
61 | .Fn getsubopt | 63 | .Fn getsubopt |
@@ -79,6 +81,11 @@ On return from | |||
79 | .Fa optionp | 81 | .Fa optionp |
80 | will be set to point to the start of the next token in the string, | 82 | will be set to point to the start of the next token in the string, |
81 | or the NUL at the end of the string if no more tokens are present. | 83 | or the NUL at the end of the string if no more tokens are present. |
84 | The comma, space, or tab character ending the token just parsed, | ||
85 | and the equal sign separating name and value if any, are replaced | ||
86 | with NUL bytes in the original | ||
87 | .Pf * Fa optionp | ||
88 | input string. | ||
82 | The external variable | 89 | The external variable |
83 | .Fa suboptarg | 90 | .Fa suboptarg |
84 | will be set to point to the start of the current token, or | 91 | will 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 | ||
149 | The | ||
150 | .Fn getsubopt | ||
151 | function conforms to | ||
152 | .St -p1003.1-2008 . | ||
153 | .Pp | ||
154 | Allowing space and tab characters to separate tokens | ||
155 | and the external variable | ||
156 | .Va suboptarg | ||
157 | are extensions to that standard. | ||
141 | .Sh HISTORY | 158 | .Sh HISTORY |
142 | The | 159 | The |
143 | .Fn getsubopt | 160 | .Fn getsubopt |