diff options
author | deraadt <> | 2005-03-30 03:04:19 +0000 |
---|---|---|
committer | deraadt <> | 2005-03-30 03:04:19 +0000 |
commit | 1228747c59a633553cbbe9bf77bcf13d6371ca5f (patch) | |
tree | 497eaca30513e775d09718188ce2fb4fde797781 /src/lib/libc/string/strstr.3 | |
parent | 3b040f7dfaf37c407ea6ede1c8c2092e6bf903fd (diff) | |
download | openbsd-1228747c59a633553cbbe9bf77bcf13d6371ca5f.tar.gz openbsd-1228747c59a633553cbbe9bf77bcf13d6371ca5f.tar.bz2 openbsd-1228747c59a633553cbbe9bf77bcf13d6371ca5f.zip |
strcasestr(3), a case-insensitive version of strstr(3). already in netbsd
and freebsd, apparently written by torek, the man we never see anymore;
submitted by jcs, but he is not around right now for the libc major crank
so i sneak it in for him
Diffstat (limited to 'src/lib/libc/string/strstr.3')
-rw-r--r-- | src/lib/libc/string/strstr.3 | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/lib/libc/string/strstr.3 b/src/lib/libc/string/strstr.3 index 64396e7885..2c8fa1888f 100644 --- a/src/lib/libc/string/strstr.3 +++ b/src/lib/libc/string/strstr.3 | |||
@@ -29,18 +29,20 @@ | |||
29 | .\" 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 |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: strstr.3,v 1.7 2005/02/25 03:12:44 cloder Exp $ | 32 | .\" $OpenBSD: strstr.3,v 1.8 2005/03/30 03:04:19 deraadt Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd June 29, 1991 | 34 | .Dd June 29, 1991 |
35 | .Dt STRSTR 3 | 35 | .Dt STRSTR 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
38 | .Nm strstr | 38 | .Nm strstr , strcasestr |
39 | .Nd locate a substring in a string | 39 | .Nd locate a substring in a string |
40 | .Sh SYNOPSIS | 40 | .Sh SYNOPSIS |
41 | .Fd #include <string.h> | 41 | .Fd #include <string.h> |
42 | .Ft char * | 42 | .Ft char * |
43 | .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" | ||
44 | .Sh DESCRIPTION | 46 | .Sh DESCRIPTION |
45 | The | 47 | The |
46 | .Fn strstr | 48 | .Fn strstr |
@@ -48,23 +50,27 @@ function locates the first occurrence of the NUL-terminated string | |||
48 | .Fa little | 50 | .Fa little |
49 | in the NUL-terminated string | 51 | in the NUL-terminated string |
50 | .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 | ||
51 | If | 60 | If |
52 | .Fa little | 61 | .Fa little |
53 | is the empty string, | 62 | is an empty string, |
54 | .Fn strstr | 63 | .Fa big |
55 | returns | 64 | is returned; |
56 | .Fa big ; | ||
57 | if | 65 | if |
58 | .Fa little | 66 | .Fa little |
59 | occurs nowhere in | 67 | occurs nowhere in |
60 | .Fa big , | 68 | .Fa big , |
61 | .Fn strstr | 69 | .Dv NULL |
62 | returns | 70 | is returned; |
63 | .Dv NULL ; | 71 | otherwise a pointer to the first character of the first occurrence of |
64 | otherwise | 72 | .Fa little |
65 | .Fn strstr | 73 | is returned. |
66 | returns a pointer to the first character of the first occurrence of | ||
67 | .Fa little . | ||
68 | .Sh SEE ALSO | 74 | .Sh SEE ALSO |
69 | .Xr memchr 3 , | 75 | .Xr memchr 3 , |
70 | .Xr strchr 3 , | 76 | .Xr strchr 3 , |