httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject Supporting line continuation in config files (fwd)
Date Sat, 15 Feb 1997 13:51:11 GMT

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>




Mime
View raw message