Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 96021 invoked by uid 500); 26 Jun 2002 18:34:02 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 96009 invoked by uid 500); 26 Jun 2002 18:34:01 -0000 Delivered-To: apmail-apache-1.3-cvs@apache.org Date: 26 Jun 2002 18:34:00 -0000 Message-ID: <20020626183400.39794.qmail@icarus.apache.org> From: coar@apache.org To: apache-1.3-cvs@apache.org Subject: cvs commit: apache-1.3/src/main http_protocol.c X-Spam-Rating: 209.66.108.5 1.6.2 0/1000/N coar 2002/06/26 11:34:00 Modified: src/main http_protocol.c Log: 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. Revision Changes Path 1.322 +15 -7 apache-1.3/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.321 retrieving revision 1.322 diff -u -u -r1.321 -r1.322 --- http_protocol.c 21 Jun 2002 09:09:15 -0000 1.321 +++ http_protocol.c 26 Jun 2002 18:34:00 -0000 1.322 @@ -123,25 +123,33 @@ "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; }