summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorville <ville@localhost>2009-11-24 19:07:44 +0000
committerville <ville@localhost>2009-11-24 19:07:44 +0000
commit5abddfdc509d328b549b187e9b48f50b8af428f7 (patch)
tree32fe3044c14bf1f1d25f1b3a3743a322491db03a
parent189e9dadfe8f153f6584996f4c40f13116badf36 (diff)
downloadmarkup-validator-5abddfdc509d328b549b187e9b48f50b8af428f7.zip
markup-validator-5abddfdc509d328b549b187e9b48f50b8af428f7.tar.gz
markup-validator-5abddfdc509d328b549b187e9b48f50b8af428f7.tar.bz2
Fix perlcritic "Nested named subroutine" errors.
-rwxr-xr-xhttpd/cgi-bin/check29
1 files changed, 9 insertions, 20 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 910cd4c..c8cc094 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -14,7 +14,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.729 2009-11-24 19:03:12 ville Exp $
+# $Id: check,v 1.730 2009-11-24 19:07:44 ville Exp $
#
# We need Perl 5.8.0+.
@@ -141,30 +141,19 @@ EOF
}
#
- # Check a filesystem path for existance and "readability".
- sub pathcheck (@)
+ # Check paths in config
+ # @@FIXME: This does not do a very good job error-message-wise if
+ # a path is missing...
{
- my %paths = map { $_ => [-d $_, -r _] } @_;
- my @_d = grep { not $paths{$_}->[0] } keys %paths;
- my @_r = grep { not $paths{$_}->[1] } keys %paths;
- return TRUE if (scalar(@_d) + scalar(@_r) == 0);
+ my %paths = map { $_ => [-d $_, -r _] } $CFG->{Paths}->{Base},
+ $CFG->{Paths}->{Templates}, $CFG->{Paths}->{SGML}->{Library};
+ my @_d = grep { not $paths{$_}->[0] } keys %paths;
+ my @_r = grep { not $paths{$_}->[1] } keys %paths;
die "Does not exist or is not a directory: @_d\n" if scalar(@_d);
die "Directory not readable (permission denied): @_r\n" if scalar(@_r);
}
#
- # Check paths in config...
- # @@FIXME: This does not do a very good job error-message-wise if a path is
- # @@FIXME: missing...;
- {
- my @dirs = ();
- push @dirs, $CFG->{Paths}->{Base};
- push @dirs, $CFG->{Paths}->{Templates};
- push @dirs, $CFG->{Paths}->{SGML}->{Library};
- &pathcheck(@dirs);
- }
-
- #
# Split allowed protocols into a list.
if (my $allowed = delete($CFG->{Protocols}->{Allow})) {
$CFG->{Protocols}->{Allow} = [split(/\s*,\s*/, $allowed)];
@@ -212,7 +201,7 @@ EOF
#
# Strings
- $VERSION = q$Revision: 1.729 $;
+ $VERSION = q$Revision: 1.730 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
#