httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Murcko <ch...@topsail.org>
Subject Re: Supporting line continuation in config files (fwd)
Date Mon, 17 Feb 1997 15:24:47 GMT
+1 for this idea. Real men's UNIX apps always allow line continuation in
config files. 8^)

Rob Hartill wrote:
> 
> Not acked.  Looks sensible.
> 
> ---------- Forwarded message ----------
> Date: Sat, 15 Feb 97 00:59:54 CST
> From: John Van Essen <vanes002@maroon.tc.umn.edu>
> To: apache-bugs@apache.org
> Subject: Supporting line continuation in config files
> 
> We have some awfully long redirection lines in our config files, and
> I wanted to use a line continuation mechanism.
> 
> I looked around in the docs, and couldn't find any explicit statement
> about the format of config file lines.  Maybe a paragraph at the top
> of the /docs/mod/directives.html file saying leading/trailing blanks
> are stripped, line length limited to X characters, no continuations.
> 
> You could also use a HOME button at the bottom of the /docs/ page
> to go to the top home page.  I have the /docs/mod/directives.html
> page bookmarked, and can't get to the root home page from there,
> only to the /docs/ home page.  :(
> 
> On to my request...
> 
> How about adding support for line continuation via a trailing backslash?
> This would allow me to have lines like this:
> 
> RedirectPermanent      /pub/games/idgames2/demos/e1m2_203.txt \
>   http://www.gamers.org/pub/games/idgames2/demos/e/e1m2_203.txt
> 
> instead of lines like this:
> 
> RedirectPermanent /pub/games/idgames2/demos/e1m2_203.txt http://www.gamers.org/pub/games/idgames2/demos/e/e1m2_203.txt
> 
> that are a hassle to read...
> 
> In util.c, in the cfg_getline function, after the test for CR shown
> below, add the additional if statement.  This has not been tested, BTW,
> but represents my best guess at what to watch for.
> 
>         if(c == CR) {
>             c = getc(f);
>         }
>         if(c == LF && i > 0 && s[i-1] == '\\') {
>             c = ' ';
>             if(--i > 0 && s[i-1] == c)
>                 --i;            /* get rid of trailing whitespace */
>             continue;           /* process escaped newline as space */
>         }
> 
> Sincerely,
> 
>         John Van Essen <jve@gamers.org>

-- 
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA
chuck@topsail.org

Mime
View raw message