Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ |
2 | #include |
||
3 | #include |
||
4 | |||
5 | char * |
||
6 | strstr(const char *s, const char *find) |
||
7 | { |
||
8 | char c, sc; |
||
9 | size_t len; |
||
10 | |||
11 | if ((c = *find++) != 0) |
||
12 | { |
||
13 | len = strlen(find); |
||
14 | do { |
||
15 | do { |
||
16 | if ((sc = *s++) == 0) |
||
17 | return 0; |
||
18 | } while (sc != c); |
||
19 | } while (strncmp(s, find, len) != 0); |
||
20 | s--; |
||
21 | } |
||
22 | return unconst(s, char *); |
||
23 | } |