httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@cpan.org>
Subject [Patch] Support for argument-less <Directive></Directive> blocks
Date Wed, 08 Oct 2003 22:16:28 GMT
With apache-1.3, mod_perl users were able to do:

<Perl>
 some code
</Perl>

in httpd-2.0, the configuration parser doesn't like container directives
with no arguments (Syntax error on line nn of httpd.conf: <Perl>
directive missing  closing '>'). So, for now, users have to resort to
using this syntax (note the extra space):

<Perl >
</Perl>

The following patch fixes this little problem:

Index: server/config.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/config.c,v
retrieving revision 1.156.2.6
diff -u -I$Id: -r1.156.2.6 config.c
--- server/config.c	17 Sep 2003 10:30:47 -0000	1.156.2.6
+++ server/config.c	8 Oct 2003 22:10:40 -0000
@@ -926,6 +926,9 @@
         if (*lastc == '>') {
             *lastc = '\0' ;
         }
+        if( cmd_name[0] == '<' && *args == '\0') {
+            args = ">";
+        }
     }
 
     newdir = apr_pcalloc(p, sizeof(ap_directive_t));

--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/    F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'

Mime
View raw message