diff options
author | Matt Fleming <matt.fleming@linux.intel.com> | 2011-07-25 14:33:00 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@linux.intel.com> | 2011-07-28 12:21:55 +0100 |
commit | d070f3d778064e5d128954b81c2afb2dce7cbb8d (patch) | |
tree | 73336b4768fa6be0cb1304dd941f06b24b870bed | |
parent | d88a088ff41963ebf4878f5e2a3248f8bd16d0c8 (diff) | |
download | efilinux-d070f3d778064e5d128954b81c2afb2dce7cbb8d.tar.gz |
stdlib.h: Add implementation of strstr
Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
-rw-r--r-- | stdlib.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -34,5 +34,25 @@ static inline int strlen(char *str) return len; } +static inline char *strstr(char *haystack, char *needle) +{ + char *p; + char *word = NULL; + int len = strlen(needle); + + if (!len) + return NULL; + + p = haystack; + while (*p) { + word = p; + if (!strncmpa((CHAR8 *)p, (CHAR8 *)needle, len)) + break; + p++; + word = NULL; + } + + return word; +} #endif /* __STDLIB_H__ */ |