gitzone

git-based zone management tool for static and dynamic domains
git clone https://git.parazyd.org/gitzone
Log | Files | Refs

commit 128b564c80228b330a342714076718aedba601f3
parent ddf67d329f5f9cd8adcd6b156cac5c093f652292
Author: tg(x) <*@tg-x.net>
Date:   Sun, 13 Feb 2011 15:33:58 +0100

-

Diffstat:
Mbin/gitzone | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/bin/gitzone b/bin/gitzone @@ -75,15 +75,16 @@ sub load_zones_config { for my $file (keys %$d) { $d->{$file} = $default_view if $d->{$file} eq 1; $d->{$file} = [$d->{$file}] if ref $d->{$file} ne 'ARRAY'; - next unless $file =~ m,^/, && -f $file; - - open FILE, '<', $file or die $!; - while (<FILE>) { - if (/^\s*zone\s+"([^"]+)"/) { - $zones->{$user}->{$dir}->{$1} = $d->{$file}; + next unless $file =~ m,^/,; + if (-f $file) { + open FILE, '<', $file or die $!; + while (<FILE>) { + if (/^\s*zone\s+"([^"]+)"/) { + $zones->{$user}->{$dir}->{$1} = $d->{$file}; + } } + close FILE; } - close FILE; delete $d->{$file} if $key ne '-default'; } }