From: Michael Wallner Date: Thu, 6 Apr 2006 09:32:27 +0000 (+0000) Subject: - there's no php_memnstr in PHP-4 X-Git-Tag: RELEASE_1_0_0RC3~12 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=fe073d54f4a2929c77e4669c380041f7f6f3bcbd - there's no php_memnstr in PHP-4 --- diff --git a/http_info_api.c b/http_info_api.c index ec238fb..95263b3 100644 --- a/http_info_api.c +++ b/http_info_api.c @@ -55,6 +55,28 @@ PHP_HTTP_API void _http_info_dtor(http_info *i) } } +#if !defined(ZEND_ENGINE_2) +inline char *php_memnstr(char *h, char *n, size_t n_len, char *e) +{ + char *p; + + if (e > h && b_len > 0) { + while (h != e) { + if (*h == *n) { + for (p = n; *p == h[p-n]; ++p) { + if (p == n+n_len-1) { + return h; + } + } + } + ++h; + } + } + + return NULL; +} +#endif + PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info, zend_bool silent TSRMLS_DC) { const char *end, *http;