Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 47195 invoked by uid 500); 22 Feb 2003 17:06:23 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 47184 invoked by uid 500); 22 Feb 2003 17:06:23 -0000 Delivered-To: apmail-apache-1.3-cvs@apache.org Date: 22 Feb 2003 17:06:21 -0000 Message-ID: <20030222170621.86523.qmail@icarus.apache.org> From: nd@apache.org To: apache-1.3-cvs@apache.org Subject: cvs commit: apache-1.3/src/support apxs.pl X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N nd 2003/02/22 09:06:20 Modified: src CHANGES src/support apxs.pl Log: insert LoadModule/AddModule directives only outside of sections. PR: 8712, 9012 Revision Changes Path 1.1881 +3 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1880 retrieving revision 1.1881 diff -u -r1.1880 -r1.1881 --- CHANGES 22 Feb 2003 15:25:43 -0000 1.1880 +++ CHANGES 22 Feb 2003 17:06:16 -0000 1.1881 @@ -1,5 +1,8 @@ Changes with Apache 1.3.28 + *) Fix apxs to insert LoadModule/AddModule directives only outside of + sections. PR 8712, 9012. [Andr� Malo] + *) Fix suexec compile error under SUNOS4, where strerror() doesn't exist. PR 5913, 9977. [Jonathan W Miner ] 1.42 +89 -4 apache-1.3/src/support/apxs.pl Index: apxs.pl =================================================================== RCS file: /home/cvs/apache-1.3/src/support/apxs.pl,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- apxs.pl 3 Feb 2003 17:13:36 -0000 1.41 +++ apxs.pl 22 Feb 2003 17:06:20 -0000 1.42 @@ -543,9 +543,69 @@ 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]; + + # the '()=' trick forces list context and the scalar + # assignment counts the number of list members (aka number + # of matches) then + my $cntopen = () = ($before =~ m|^\s*<[^/].*$|mg); + my $cntclose = () = ($before =~ m|^\s* etc. see above for explanations. + + my $before = ($content =~ m|^(.*\n)#?\s*AddModule\s+[^\n]+\n|s)[0]; + my $cntopen = () = ($before =~ m|^\s*<[^/].*$|mg); + my $cntclose = () = ($before =~ m|^\s*