summaryrefslogtreecommitdiff
path: root/lib/Apache/Config/Preproc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-12-13 09:42:08 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2017-12-13 09:44:59 +0200
commit8bc0f681b3f416f3c3dcbcad6ba2010cbd77f4c6 (patch)
tree08eb462ff4dd0925f0cfd07467b35b244d1d1639 /lib/Apache/Config/Preproc
parent9c45310caac8c962d99a316a722d42874385a823 (diff)
downloadacpp-8bc0f681b3f416f3c3dcbcad6ba2010cbd77f4c6.tar.gz
acpp-8bc0f681b3f416f3c3dcbcad6ba2010cbd77f4c6.tar.bz2
Bugfixes
* lib/Apache/Config/Preproc/include.pm (new): Select included file table implementation basing on the OS name. Fix copy-paste error in NAME section. * lib/Apache/Config/Preproc/ifdefine.pm: Fix copy-paste error in NAME section. * lib/Apache/Config/Preproc.pm: Raise version number. * Changes: New release.
Diffstat (limited to 'lib/Apache/Config/Preproc')
-rw-r--r--lib/Apache/Config/Preproc/ifdefine.pm2
-rw-r--r--lib/Apache/Config/Preproc/include.pm21
2 files changed, 21 insertions, 2 deletions
diff --git a/lib/Apache/Config/Preproc/ifdefine.pm b/lib/Apache/Config/Preproc/ifdefine.pm
index 834d602..5bf3a3f 100644
--- a/lib/Apache/Config/Preproc/ifdefine.pm
+++ b/lib/Apache/Config/Preproc/ifdefine.pm
@@ -117,3 +117,3 @@ __END__
-Apache::Config::Preproc::ifmodule - expand IfDefine sections
+Apache::Config::Preproc::ifdefine - expand IfDefine sections
diff --git a/lib/Apache/Config/Preproc/include.pm b/lib/Apache/Config/Preproc/include.pm
index 32b753d..f7c851c 100644
--- a/lib/Apache/Config/Preproc/include.pm
+++ b/lib/Apache/Config/Preproc/include.pm
@@ -6,2 +6,3 @@ use Apache::Config::Preproc;
use File::Spec;
+use Cwd 'abs_path';
use Carp;
@@ -15,2 +16,5 @@ sub new {
croak "unrecognized arguments" if keys(%_);
+ $self->{check_included} = $^O eq 'MSWin32'
+ ? \&_check_included_path
+ : \&_check_included_stat;
return $self;
@@ -67,2 +71,8 @@ sub check_included {
my ($self, $file) = @_;
+ return $self->${ \ $self->{check_included} }($file);
+}
+
+# Default included file table for unix-like OSes
+sub _check_included_stat {
+ my ($self, $file) = @_;
my ($dev,$ino) = stat($file) or return 0;
@@ -73,2 +83,11 @@ sub check_included {
+# Path-bases file table, for defective OSes (MSWin32)
+sub _check_included_path {
+ my ($self, $file) = @_;
+ my $path = abs_path($file);
+ return 1 if $self->{included}{$path};
+ $self->{included}{$path} = 1;
+ return 0;
+}
+
1;
@@ -79,3 +98,3 @@ __END__
-Apache::Config::Preproc::ifmodule - expand Include statements
+Apache::Config::Preproc::include - expand Include statements

Return to:

Send suggestions and report system problems to the System administrator.