httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] from uunet: mod_dir titles
Date Fri, 22 Aug 1997 17:11:23 GMT
[I received a bunch of patches from UUnet which they apply to every
release.  I busted them apart into smaller pieces, but haven't tested any
of them.  Consider this to be a +1 for inclusion in 1.3.  I'm hoping
someone else will redo these as patches against 1.3.]

Dean

Thu Aug 14 12:01:28 1997  David J. MacKenzie  <djm@va.pubnix.com>

	* mod_dir.c: Check for titles in server-parsed HTML files.
	Ignore leading newlines and returns in titles.  The old behavior
	of replacing a newline after <title> with a space causes the
	title to be misaligned in the listing. 

Index: src/mod_dir.c
--- mod_dir.c	1997/07/08 21:08:31	1.1
+++ mod_dir.c	1997/07/08 21:22:46	1.2
@@ -481,7 +481,10 @@
     if (r->status != HTTP_OK) {
 	return NULL;
     }
-    if (r->content_type && !strcmp(r->content_type,"text/html") &&
!r->content_encoding) {
+    if (r->content_type
+	&& (!strcmp(r->content_type,"text/html")
+	    || !strcmp(r->content_type,INCLUDES_MAGIC_TYPE))
+	&& !r->content_encoding) {
         if(!(thefile = pfopen(r->pool, r->filename,"r")))
             return NULL;
         n = fread(titlebuf,sizeof(char),MAX_STRING_LEN - 1,thefile);
@@ -494,6 +497,9 @@
                     /* Scan for line breaks for Tanmoy's secretary */
                     for(y=x;titlebuf[y];y++)
                         if((titlebuf[y] == CR) || (titlebuf[y] == LF))
+			  if (y==x)
+			    x++;
+			  else
                             titlebuf[y] = ' ';
 		    pfclose (r->pool, thefile);
                     return pstrdup(r->pool, &titlebuf[x]);


Mime
View raw message