From 6ee892156e49a2354199a1ef22984470ca780bed Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 12 Mar 2008 18:10:17 +0000 Subject: [PATCH] moved filter_domains() git-svn-id: svn+ssh://foo-projects.org/var/svn/ferm/trunk@1185 887c3e53-ddf1-0310-8e39-e0d3fab4ed34 --- src/ferm | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/ferm b/src/ferm index 0905655..63322e4 100755 --- a/src/ferm +++ b/src/ferm @@ -668,6 +668,25 @@ sub initialize_domain { $domain_info->{initialized} = 1; } +sub filter_domains($) { + my $domains = shift; + my $result = []; + + foreach my $domain (to_array $domains) { + next if exists $option{domain} + and $domain ne $option{domain}; + + eval { + initialize_domain($domain); + }; + error($@) if $@; + + push @$result, $domain; + } + + return @$result == 1 ? $result->[0] : $result; +} + # split the an input string into words and delete comments sub tokenize_string($) { my $string = shift; @@ -1292,25 +1311,6 @@ sub mkrules($) { } } -sub filter_domains($) { - my $domains = shift; - my $result = []; - - foreach my $domain (to_array $domains) { - next if exists $option{domain} - and $domain ne $option{domain}; - - eval { - initialize_domain($domain); - }; - error($@) if $@; - - push @$result, $domain; - } - - return @$result == 1 ? $result->[0] : $result; -} - # parse a keyword from a module definition sub parse_keyword($$$$) { my ($rule, $def, $keyword, $negated_ref) = @_; -- 2.11.4.GIT