You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1996/04/02 16:58:40 UTC

apache 1.0.3 ScanHTMLTitles improvement (fwd)

I'll ack this..


Date: Tue, 2 Apr 1996 09:52:24 -0500
Message-Id: <JA...@catapult.va.pubnix.com>
From: "David J. MacKenzie" <dj...@va.pubnix.com>
To: apache-bugs@apache.org
cc: djm@va.pubnix.com
Subject: apache 1.0.3 ScanHTMLTitles improvement
X-Quote: 
   Just once, I wish we would encounter an alien menace that wasn't
   immune to bullets -- The Brigader in Dr Who

From: David MacKenzie <dj...@va.pubnix.com>
Subject: ScanHTMLTitles handles newlines suboptimally
Affects: mod_dir.c
ChangeLog: Ignore leading newlines and returns in titles
Comments: A common format for title directives is
<title>
This Document's Title
</title>
Stock apache 1.0.3 replaces the newline after <title> with a space,
causing the title to be misaligned in the listing.  This patch handles
that case better by skipping leading newlines and returns.

*** 1.2	1996/04/01 18:57:31
--- mod_dir.c	1996/04/02 14:42:00
***************
*** 477,483 ****
                      /* Scan for line breaks for Tanmoy's secretary */
                      for(y=x;titlebuf[y];y++)
                          if((titlebuf[y] == CR) || (titlebuf[y] == LF))
!                             titlebuf[y] = ' ';
  		    pfclose (r->pool, thefile);
                      return pstrdup(r->pool, &titlebuf[x]);
                  }
--- 477,486 ----
                      /* 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]);
                  }