From: Andre Malo Date: Wed, 19 Feb 2003 03:01:21 +0000 (+0000) Subject: insert LoadModule directives only outside of sections. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c2b6f44de6afd95ecfcc137ba29d88e5494c446;p=apache insert LoadModule directives only outside of sections. PR: 9012 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98721 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 4d939855e8..a8b291b80e 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) Fix apxs to insert LoadModule directives only outside of sections. + PR 9012. [André Malo] + *) Hook mod_proxy's fixup before mod_rewrite's fixup, so that by mod_rewrite proxied URLs will not be escaped accidentally by mod_proxy's fixup. PR 16368 [André Malo] diff --git a/support/apxs.in b/support/apxs.in index 184f6727bf..fe545a883d 100644 --- a/support/apxs.in +++ b/support/apxs.in @@ -577,9 +577,30 @@ if ($opt_i or $opt_e) { foreach $lmd (@lmd) { my $what = $opt_A ? "preparing" : "activating"; if ($content !~ m|\n#?\s*$lmd|) { - $content =~ s|^(.*\n#?\s*LoadModule\s+[^\n]+\n)|$1$c$lmd\n|sg; + # check for open , so that the new LoadModule + # directive always appears *outside* of an . + + my $before = ($content =~ m|^(.*\n)#?\s*LoadModule\s+[^\n]+\n|s)[0]; + my $cntopen = () = ($before =~ m|^\s*<[^/].*$|mg); + my $cntclose = () = ($before =~ m|^\s*