Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 26457 invoked by uid 6000); 11 May 1999 17:40:03 -0000 Received: (qmail 26182 invoked from network); 11 May 1999 17:39:26 -0000 Received: from 57.37.252.198.in-addr.rsbx.net (HELO mail.rsbx.net) (198.252.37.57) by taz.hyperreal.org with SMTP; 11 May 1999 17:39:26 -0000 Received: from rsbx.net (localhost [127.0.0.1]) by mail.rsbx.net (8.9.3/8.9.3) with ESMTP id NAA14577 for ; Tue, 11 May 1999 13:39:22 -0400 Message-ID: <37386B4A.D2693383@rsbx.net> Date: Tue, 11 May 1999 13:39:22 -0400 From: Raymond S Brand X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.36.tc i686) X-Accept-Language: en MIME-Version: 1.0 To: new-httpd@apache.org Subject: Re: [PATCH] ReadmeName and HeaderName files server-parsed and content negotiated. References: Content-Type: multipart/mixed; boundary="------------3D621FD6E746929390829462" Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org This is a multi-part message in MIME format. --------------3D621FD6E746929390829462 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dean Gaudet wrote: > Could you reformat following the style guide? > http://dev.apache.org/styleguide.html Oops! I didn't get the formatting anywhere close to correct. The following 2 "style" patches should correct the situation. Raymond S Brand --------------3D621FD6E746929390829462 Content-Type: text/plain; charset=us-ascii; name="mod_autoindex.c-diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mod_autoindex.c-diff.txt" --- mod_autoindex.c-orig Tue May 11 12:48:15 1999 +++ mod_autoindex.c-new Tue May 11 13:27:40 1999 @@ -893,43 +893,43 @@ */ static void do_emit_plain(request_rec *r, FILE *f) { - char buf[IOBUFSIZE + 1]; - int i, n, c, ch; + char buf[IOBUFSIZE + 1]; + int i, n, c, ch; - ap_rputs("
\n", r);
-	while (!feof(f)) {
-	    do {
-		n = fread(buf, sizeof(char), IOBUFSIZE, f);
-	    }
-	    while (n == -1 && ferror(f) && errno == EINTR);
-	    if (n == -1 || n == 0) {
-		break;
-	    }
-	    buf[n] = '\0';
-	    c = 0;
-	    while (c < n) {
-	        for (i = c; i < n; i++) {
-		    if (buf[i] == '<' || buf[i] == '>' || buf[i] == '&') {
-			break;
-		    }
-		}
-		ch = buf[i];
-		buf[i] = '\0';
-		ap_rputs(&buf[c], r);
-		if (ch == '<') {
-		    ap_rputs("<", r);
-		}
-		else if (ch == '>') {
-		    ap_rputs(">", r);
-		}
-		else if (ch == '&') {
-		    ap_rputs("&", r);
+    ap_rputs("
\n", r);
+    while (!feof(f)) {
+	do {
+	    n = fread(buf, sizeof(char), IOBUFSIZE, f);
+	}
+	while (n == -1 && ferror(f) && errno == EINTR);
+	if (n == -1 || n == 0) {
+	    break;
+	}
+	buf[n] = '\0';
+	c = 0;
+	while (c < n) {
+	    for (i = c; i < n; i++) {
+		if (buf[i] == '<' || buf[i] == '>' || buf[i] == '&') {
+		    break;
 		}
-		c = i + 1;
 	    }
+	    ch = buf[i];
+	    buf[i] = '\0';
+	    ap_rputs(&buf[c], r);
+	    if (ch == '<') {
+		ap_rputs("<", r);
+	    }
+	    else if (ch == '>') {
+		ap_rputs(">", r);
+	    }
+	    else if (ch == '&') {
+		ap_rputs("&", r);
+	    }
+	    c = i + 1;
 	}
-    ap_rputs("
\n", r); } + ap_rputs("
\n", r); +} /* See mod_include */ #define SUB_REQ_STRING "Sub request to mod_include" @@ -939,80 +939,78 @@ * Handle the preamble through the H1 tag line, inclusive. */ static void emit_head(request_rec *r, char *header_fname, int suppress_amble, - char *title) - { + char *title) +{ FILE *f; request_rec *rr = NULL; int emit_H1 = 0; if (header_fname - && (rr = ap_sub_req_lookup_uri(header_fname, r)) - && (rr->status == HTTP_OK) - && (rr->filename) - && S_ISREG(rr->finfo.st_mode)) { - if ((rr->content_type) - && !strcmp("text/html", rr->content_type)) { + && (rr = ap_sub_req_lookup_uri(header_fname, r)) + && (rr->status == HTTP_OK) + && (rr->filename) + && S_ISREG(rr->finfo.st_mode)) { + if ((rr->content_type) && !strcmp("text/html", rr->content_type)) { emit_preamble(r, title, suppress_amble); ap_table_add(r->notes, PARENT_STRING, ""); ap_table_add(rr->notes, SUB_REQ_STRING, ""); if (ap_run_sub_req(rr)) { emit_preamble(r, title, !suppress_amble); emit_H1 = 1; - } } + } else { emit_preamble(r, title, 0); if (f = ap_pfopen(r->pool, rr->filename, "r")) { do_emit_plain(r, f); - ap_pfclose(r->pool, f); - } + ap_pfclose(r->pool, f); + } else { emit_H1 = 1; - } } } + } else { emit_preamble(r, title, 0); - emit_H1 = 1; - } + emit_H1 = 1; + } if (emit_H1) { ap_rvputs(r, "

Index of ", title, "

\n", NULL); } if (rr) { ap_destroy_sub_req(rr); } - } +} /* * Handle the Readme file through the postamble, inclusive. */ static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble) - { +{ FILE *f; request_rec *rr = NULL; int suppress_post = 0; int suppress_sig = 0; if (readme_fname - && (rr = ap_sub_req_lookup_uri(readme_fname, r)) - && (rr->status == HTTP_OK) - && (rr->filename) - && S_ISREG(rr->finfo.st_mode)) { - if ((rr->content_type) - && !strcmp("text/html", rr->content_type)) { + && (rr = ap_sub_req_lookup_uri(readme_fname, r)) + && (rr->status == HTTP_OK) + && (rr->filename) + && S_ISREG(rr->finfo.st_mode)) { + if ((rr->content_type) && !strcmp("text/html", rr->content_type)) { ap_table_add(r->notes, PARENT_STRING, ""); ap_table_add(rr->notes, SUB_REQ_STRING, ""); if (!ap_run_sub_req(rr)) { suppress_sig = 1; suppress_post = suppress_amble; - } } + } else { if (f = ap_pfopen(r->pool, rr->filename, "r")) { do_emit_plain(r, f); ap_pfclose(r->pool, f); suppress_sig = 1; - } } } + } if (!suppress_sig) { ap_rputs(ap_psignature("", r), r); } if (!suppress_post) { ap_rputs("\n", r); } @@ -1479,7 +1477,7 @@ } emit_head(r, find_header(autoindex_conf, r), - autoindex_opts & SUPPRESS_PREAMBLE, title_name); + autoindex_opts & SUPPRESS_PREAMBLE, title_name); /* * Figure out what sort of indexing (if any) we're supposed to use. @@ -1548,7 +1546,7 @@ ap_rputs("
\n", r); } emit_tail(r, find_readme(autoindex_conf, r), - autoindex_opts & SUPPRESS_PREAMBLE); + autoindex_opts & SUPPRESS_PREAMBLE); ap_kill_timeout(r); return 0; --------------3D621FD6E746929390829462 Content-Type: text/plain; charset=us-ascii; name="mod_include.c-diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mod_include.c-diff.txt" --- mod_include.c-orig Tue May 11 12:48:07 1999 +++ mod_include.c-new Tue May 11 13:15:38 1999 @@ -2368,8 +2368,7 @@ #define SUB_REQ_STRING "Sub request to mod_include" #define PARENT_STRING "Parent request to mod_include" - if (ap_table_get(r->notes, SUB_REQ_STRING)) - { + if (ap_table_get(r->notes, SUB_REQ_STRING)) { request_rec *p = r->main; /* @@ -2396,7 +2395,7 @@ add_include_vars(p, DEFAULT_TIME_FORMAT); ap_table_unset(r->notes, SUB_REQ_STRING); break; - } + } p = (p->prev) ? p->prev : p->main; } } --------------3D621FD6E746929390829462--