]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Style police; there appears to be a bug in here somewhere
authorKen Coar <coar@apache.org>
Wed, 26 Jun 2002 18:34:00 +0000 (18:34 +0000)
committerKen Coar <coar@apache.org>
Wed, 26 Jun 2002 18:34:00 +0000 (18:34 +0000)
(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

index 6be669599a04596ed11c0dc3735f0381ce9fd515..403d9b17a55055ce1e6bc196c3092c2825857b78 100644 (file)
@@ -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;
 }