You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2017/03/21 23:08:27 UTC
svn commit: r1788033 - /httpd/httpd/trunk/modules/generators/mod_autoindex.c
Author: jailletc36
Date: Tue Mar 21 23:08:27 2017
New Revision: 1788033
URL: http://svn.apache.org/viewvc?rev=1788033&view=rev
Log:
Use 'ap_cstr_casecmp' to simplify code.
Remove useless case. We know that to can not be NULL at this point.
Modified:
httpd/httpd/trunk/modules/generators/mod_autoindex.c
Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=1788033&r1=1788032&r2=1788033&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Tue Mar 21 23:08:27 2017
@@ -156,9 +156,9 @@ static char c_by_encoding, c_by_type, c_
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
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);
}
}