diff options
author | Stefan Fritsch <sf@apache.org> | 2011-10-24 13:20:28 +0200 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2011-10-24 13:20:28 +0200 |
commit | f7e2ea6e3a8c2b97d96bdb127fd19831a3a948f2 (patch) | |
tree | 3f9dae3402379eec44654a93078369ab69c2b0de /modules/filters | |
parent | eol-style native for new files (diff) | |
download | apache2-f7e2ea6e3a8c2b97d96bdb127fd19831a3a948f2.tar.xz apache2-f7e2ea6e3a8c2b97d96bdb127fd19831a3a948f2.zip |
Make loop more efficient as pointed out by Roy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1188094 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/filters')
-rw-r--r-- | modules/filters/mod_filter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index dc1a4c79c3..936cc529a0 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -162,12 +162,12 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter) } else if (r->content_type) { const char **type = provider->types; + size_t len = strcspn(r->content_type, "; \t"); AP_DEBUG_ASSERT(type != NULL); while (*type) { /* Handle 'content-type;charset=...' correctly */ - size_t len = strcspn(r->content_type, "; \t"); - if (strlen(*type) == len - && strncmp(*type, r->content_type, len) == 0) { + if (strncmp(*type, r->content_type, len) == 0 + && (*type)[len] == '\0') { match = 1; break; } |