summaryrefslogtreecommitdiff
path: root/modules/generators
diff options
context:
space:
mode:
authorChristophe Jaillet <jailletc36@apache.org>2017-03-21 23:08:27 +0000
committerChristophe Jaillet <jailletc36@apache.org>2017-03-21 23:08:27 +0000
commit4c3dc1b74836f40c3a1b8b5d320b6cb14e39506c (patch)
tree0be80332481ebf95ce618c959502d226f0b7caf6 /modules/generators
parentefcbe8209591acb95265f92a25fd083632e4d1b1 (diff)
downloadhttpd-4c3dc1b74836f40c3a1b8b5d320b6cb14e39506c.tar.gz
Use 'ap_cstr_casecmp' to simplify code.
Remove useless case. We know that to can not be NULL at this point. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1788033 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/generators')
-rw-r--r--modules/generators/mod_autoindex.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c
index 9473a87e4d..6a32de803d 100644
--- a/modules/generators/mod_autoindex.c
+++ b/modules/generators/mod_autoindex.c
@@ -156,9 +156,9 @@ static char c_by_encoding, c_by_type, c_by_path;
static APR_INLINE int response_is_html(request_rec *r)
{
char *ctype = ap_field_noparam(r->pool, r->content_type);
- ap_str_tolower(ctype);
- return !strcmp(ctype, "text/html")
- || !strcmp(ctype, "application/xhtml+xml");
+
+ return !ap_cstr_casecmp(ctype, "text/html")
+ || !ap_cstr_casecmp(ctype, "application/xhtml+xml");
}
/*
@@ -214,11 +214,8 @@ static void push_item(apr_array_header_t *arr, char *type, const char *to,
if ((type == BY_PATH) && (!ap_is_matchexp(to))) {
p->apply_to = apr_pstrcat(arr->pool, "*", to, NULL);
}
- else if (to) {
- p->apply_to = apr_pstrdup(arr->pool, to);
- }
else {
- p->apply_to = NULL;
+ p->apply_to = apr_pstrdup(arr->pool, to);
}
}