From 9f926596a71a7f5a29bd9f74ad830e31e49f5ab2 Mon Sep 17 00:00:00 2001 From: Ken Coar Date: Wed, 26 Jun 2002 18:34:00 +0000 Subject: [PATCH] Style police; there appears to be a bug in here somewhere (see bugzilla #10259), and I want to get the code style fix out of the way first. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@95890 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/http_protocol.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/http_protocol.c b/src/main/http_protocol.c index 6be669599a0..403d9b17a55 100644 --- a/src/main/http_protocol.c +++ b/src/main/http_protocol.c @@ -123,25 +123,33 @@ static const char *make_content_type(request_rec *r, const char *type) { "text/html", NULL }; char **pcset; - core_dir_config *conf = (core_dir_config *)ap_get_module_config( - r->per_dir_config, &core_module); - if (!type) type = ap_default_type(r); - if (conf->add_default_charset != ADD_DEFAULT_CHARSET_ON) return type; + core_dir_config *conf; + + conf = (core_dir_config *)ap_get_module_config(r->per_dir_config, + &core_module); + if (!type) { + type = ap_default_type(r); + } + if (conf->add_default_charset != ADD_DEFAULT_CHARSET_ON) { + return type; + } if (ap_strcasestr(type, "charset=") != NULL) { /* already has parameter, do nothing */ /* XXX we don't check the validity */ ; - } else { + } + else { /* see if it makes sense to add the charset. At present, * we only add it if the Content-type is one of needcset[] */ - for (pcset = needcset; *pcset ; pcset++) + for (pcset = needcset; *pcset ; pcset++) { if (ap_strcasestr(type, *pcset) != NULL) { type = ap_pstrcat(r->pool, type, "; charset=", - conf->add_default_charset_name, NULL); + conf->add_default_charset_name, NULL); break; } + } } return type; } -- 2.47.2