diff options
Diffstat (limited to 'src/lib/libc/string/strstr.3')
-rw-r--r-- | src/lib/libc/string/strstr.3 | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/lib/libc/string/strstr.3 b/src/lib/libc/string/strstr.3 index 24fdf540ed..2c8fa1888f 100644 --- a/src/lib/libc/string/strstr.3 +++ b/src/lib/libc/string/strstr.3 | |||
@@ -13,11 +13,7 @@ | |||
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | 13 | .\" 2. Redistributions in binary form must reproduce the above copyright |
14 | .\" notice, this list of conditions and the following disclaimer in the | 14 | .\" notice, this list of conditions and the following disclaimer in the |
15 | .\" documentation and/or other materials provided with the distribution. | 15 | .\" documentation and/or other materials provided with the distribution. |
16 | .\" 3. All advertising materials mentioning features or use of this software | 16 | .\" 3. Neither the name of the University nor the names of its contributors |
17 | .\" must display the following acknowledgement: | ||
18 | .\" This product includes software developed by the University of | ||
19 | .\" California, Berkeley and its contributors. | ||
20 | .\" 4. Neither the name of the University nor the names of its contributors | ||
21 | .\" may be used to endorse or promote products derived from this software | 17 | .\" may be used to endorse or promote products derived from this software |
22 | .\" without specific prior written permission. | 18 | .\" without specific prior written permission. |
23 | .\" | 19 | .\" |
@@ -33,47 +29,50 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
35 | .\" | 31 | .\" |
36 | .\" from: @(#)strstr.3 5.3 (Berkeley) 6/29/91 | 32 | .\" $OpenBSD: strstr.3,v 1.8 2005/03/30 03:04:19 deraadt Exp $ |
37 | .\" $Id: strstr.3,v 1.1.1.1 1995/10/18 08:42:23 deraadt Exp $ | ||
38 | .\" | 33 | .\" |
39 | .Dd June 29, 1991 | 34 | .Dd June 29, 1991 |
40 | .Dt STRSTR 3 | 35 | .Dt STRSTR 3 |
41 | .Os | 36 | .Os |
42 | .Sh NAME | 37 | .Sh NAME |
43 | .Nm strstr | 38 | .Nm strstr , strcasestr |
44 | .Nd locate a substring in a string | 39 | .Nd locate a substring in a string |
45 | .Sh SYNOPSIS | 40 | .Sh SYNOPSIS |
46 | .Fd #include <string.h> | 41 | .Fd #include <string.h> |
47 | .Ft char * | 42 | .Ft char * |
48 | .Fn strstr "const char *big" "const char *little" | 43 | .Fn strstr "const char *big" "const char *little" |
44 | .Ft char * | ||
45 | .Fn strcasestr "const char *big" "const char *little" | ||
49 | .Sh DESCRIPTION | 46 | .Sh DESCRIPTION |
50 | The | 47 | The |
51 | .Fn strstr | 48 | .Fn strstr |
52 | function | 49 | function locates the first occurrence of the NUL-terminated string |
53 | locates the first occurrence of the null-terminated string | ||
54 | .Fa little | 50 | .Fa little |
55 | in the null-terminated string | 51 | in the NUL-terminated string |
56 | .Fa big . | 52 | .Fa big . |
53 | .Pp | ||
54 | The | ||
55 | .Fn strcasestr | ||
56 | function is similar to | ||
57 | .Fn strstr | ||
58 | but ignores the case of both strings. | ||
59 | .Pp | ||
57 | If | 60 | If |
58 | .Fa little | 61 | .Fa little |
59 | is the empty string, | 62 | is an empty string, |
60 | .Fn strstr | 63 | .Fa big |
61 | returns | 64 | is returned; |
62 | .Fa big ; | ||
63 | if | 65 | if |
64 | .Fa little | 66 | .Fa little |
65 | occurs nowhere in | 67 | occurs nowhere in |
66 | .Fa big , | 68 | .Fa big , |
67 | .Fn strstr | 69 | .Dv NULL |
68 | returns NULL; | 70 | is returned; |
69 | otherwise | 71 | otherwise a pointer to the first character of the first occurrence of |
70 | .Fn strstr | 72 | .Fa little |
71 | returns a pointer to the first character of the first occurrence of | 73 | is returned. |
72 | .Fa little . | ||
73 | .Sh SEE ALSO | 74 | .Sh SEE ALSO |
74 | .Xr index 3 , | ||
75 | .Xr memchr 3 , | 75 | .Xr memchr 3 , |
76 | .Xr rindex 3 , | ||
77 | .Xr strchr 3 , | 76 | .Xr strchr 3 , |
78 | .Xr strcspn 3 , | 77 | .Xr strcspn 3 , |
79 | .Xr strpbrk 3 , | 78 | .Xr strpbrk 3 , |
@@ -84,6 +83,5 @@ returns a pointer to the first character of the first occurrence of | |||
84 | .Sh STANDARDS | 83 | .Sh STANDARDS |
85 | The | 84 | The |
86 | .Fn strstr | 85 | .Fn strstr |
87 | function | 86 | function conforms to |
88 | conforms to | ||
89 | .St -ansiC . | 87 | .St -ansiC . |