1
/* Copyright (C) 2002 MySQL AB
3
This library is free software; you can redistribute it and/or
4
modify it under the terms of the GNU Library General Public
5
License as published by the Free Software Foundation; version 2
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public
14
License along with this library; if not, write to the Free
15
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23
strstr(src, pat) looks for an instance of pat in src. pat is not a
24
regex(3) pattern, it is a literal string which must be matched exactly.
25
The result is a pointer to the first character of the located instance,
26
or NullS if pat does not occur in src.
30
#include <my_global.h>
35
char *strstr(register const char *str,const char *search)
38
register char first= *search;
41
while (*str != '\0') {
42
if (*str++ == first) {
43
i=(char*) str; j=(char*) search+1;
45
if (*i++ != *j++) goto skip;
46
return ((char*) str-1);