From 3c5d81e4e157d4cd1abc10bb76811e16936bdf6d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 28 May 2012 02:05:42 +0200 Subject: searchalias: Fix silly bug with operator associativity --- fripost-searchalias | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fripost-searchalias') diff --git a/fripost-searchalias b/fripost-searchalias index 719cd01..65f1d4b 100755 --- a/fripost-searchalias +++ b/fripost-searchalias @@ -139,15 +139,10 @@ sub perform_search { my $f = $conf->{from}; my $g = $conf->{goto}; -my $from ||= $f || not $f && not $g; -my $goto ||= $g || not $f && not $g; +my $from = $f || !$f && !$g; +my $goto = $g || !$f && !$g; -if ($g) { - say " Searchin 'goto'"; - perform_search(goto => $ARGV[0]); -} - -if ($f) { +if ($from) { say " Searchin 'from'"; perform_search(address => $ARGV[0]); @@ -157,6 +152,11 @@ if ($f) { or die "Error: Unknown domain `$d'.\n"; } +if ($goto) { + say " Searchin 'goto'"; + perform_search(goto => $ARGV[0]); +} + $ldap->unbind(); -- cgit v1.2.3