1 /******************************************************************************
5 * Find the first occurrence of a string in another string. *
8 * return = strstr(Source,What); *
16 ******************************************************************************/
18 char *strstr(Source, What)
19 register const char *Source;
20 register const char *What;
22 register char WhatChar;
23 register char SourceChar;
27 if ((WhatChar = *What++) != 0) {
28 Length = strlen(What);
31 if ((SourceChar = *Source++) == 0) {
34 } while (SourceChar != WhatChar);
35 } while (strncmp(Source, What, Length) != 0);
38 return ((char *)Source);