summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2017-12-13 07:42:08 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-12-13 07:44:59 (GMT)
commit8bc0f681b3f416f3c3dcbcad6ba2010cbd77f4c6 (patch) (side-by-side diff)
tree08eb462ff4dd0925f0cfd07467b35b244d1d1639
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 (more/less context) (ignore whitespace changes)
-rw-r--r--Changes4
-rw-r--r--lib/Apache/Config/Preproc.pm2
-rw-r--r--lib/Apache/Config/Preproc/ifdefine.pm2
-rw-r--r--lib/Apache/Config/Preproc/include.pm21
4 files changed, 26 insertions, 3 deletions
diff --git a/Changes b/Changes
index 43bff9a..f7f4803 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+1.01 2017-12-12
+
+* Minor fixes
+
1.00 2017-12-12
* Initial release
diff --git a/lib/Apache/Config/Preproc.pm b/lib/Apache/Config/Preproc.pm
index 10bf4a3..03d2c9a 100644
--- a/lib/Apache/Config/Preproc.pm
+++ b/lib/Apache/Config/Preproc.pm
@@ -4,7 +4,7 @@ use strict;
use warnings;
use Carp;
-our $VERSION = '1.0';
+our $VERSION = '1.01';
sub new {
my $class = shift;
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
@@ -115,7 +115,7 @@ __END__
=head1 NAME
-Apache::Config::Preproc::ifmodule - expand IfDefine sections
+Apache::Config::Preproc::ifdefine - expand IfDefine sections
=head1 SYNOPSIS
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
@@ -4,6 +4,7 @@ use warnings;
use Apache::Admin::Config;
use Apache::Config::Preproc;
use File::Spec;
+use Cwd 'abs_path';
use Carp;
sub new {
@@ -13,6 +14,9 @@ sub new {
local %_ = @_;
$self->{server_root} = delete $_{server_root};
croak "unrecognized arguments" if keys(%_);
+ $self->{check_included} = $^O eq 'MSWin32'
+ ? \&_check_included_path
+ : \&_check_included_stat;
return $self;
}
@@ -65,19 +69,34 @@ sub expand {
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;
return 1 if $self->{included}{$dev}{$ino};
$self->{included}{$dev}{$ino} = 1;
return 0;
}
+# 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;
__END__
=head1 NAME
-Apache::Config::Preproc::ifmodule - expand Include statements
+Apache::Config::Preproc::include - expand Include statements
=head1 SYNOPSIS

Return to:

Send suggestions and report system problems to the System administrator.