diff options
author | ot <ot@localhost> | 2005-05-09 08:55:31 +0000 |
---|---|---|
committer | ot <ot@localhost> | 2005-05-09 08:55:31 +0000 |
commit | 3f922c14964f45c3ed9bf3c3b0978c7693549f63 (patch) | |
tree | 83c0a132d9a082eb207e58fe48fed5d3f4dba32b | |
parent | 8fbdbdd80fdc21967ddc7d2e9a9e04bfa2a6f8d2 (diff) | |
download | markup-validator-3f922c14964f45c3ed9bf3c3b0978c7693549f63.zip markup-validator-3f922c14964f45c3ed9bf3c3b0978c7693549f63.tar.gz markup-validator-3f922c14964f45c3ed9bf3c3b0978c7693549f63.tar.bz2 |
uniq'ing the list of non-root namespaces before passing it to results template
-rwxr-xr-x | httpd/cgi-bin/check | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 0d0ba89..d0f863f 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -9,7 +9,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.416 2005-05-09 05:51:33 ot Exp $ +# $Id: check,v 1.417 2005-05-09 08:55:31 ot Exp $ # # Disable buffering on STDOUT! @@ -220,7 +220,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.416 $; + $VERSION = q$Revision: 1.417 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -935,6 +935,14 @@ sub prep_template ($$) { # # Namespaces... $T->param(file_namespace => $File->{Namespace}); + my %seen_ns = (); + my @bulk_ns = @{$File->{Namespaces}}; + $File->{Namespaces} = []; # reinitialize the list of non-root namespaces + my $single_namespace; + # ... and then get a uniq version of it + foreach $single_namespace (@bulk_ns) { + push(@{$File->{Namespaces}}, $single_namespace) unless $seen_ns{$single_namespace}++; + } my @nss = map({uri => $_}, @{$File->{Namespaces}}); $T->param(file_namespaces => \@nss) if @nss; |