X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FInifile.pm;h=8ec3e80bde517b50c52f9a4c392355543b71ff01;hb=aa58b34667224cf0ca0039cd9854509b5e126be9;hp=7a2ffa7b2ca0fa9801a7e047e62d34a5ed1e8eb7;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/SL/Inifile.pm b/SL/Inifile.pm index 7a2ffa7b2..8ec3e80bd 100644 --- a/SL/Inifile.pm +++ b/SL/Inifile.pm @@ -18,7 +18,7 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -35,17 +35,16 @@ package Inifile; - sub new { $main::lxdebug->enter_sub(); my ($type, $file, $level) = @_; - + my $id = ""; my $skip; - + $type = ref($self) || $self; - + open FH, "$file" or Form->error("$file : $!"); while () { @@ -56,7 +55,7 @@ sub new { # strip comments s/\s*(#|;).*//g; - + # remove any trailing whitespace s/^\s*(.*?)\s*$/$1/; @@ -67,30 +66,30 @@ sub new { # if there is a level skip if ($skip = ($id !~ /^$level/)) { - next; + next; } - push @{$self->{ORDER}}, $_; - + push @{ $self->{ORDER} }, $_; + next; - + } if (!$skip) { + # add key=value to $id my ($key, $value) = split /=/, $_, 2; - + $self->{$id}{$key} = $value; } } close FH; - + $main::lxdebug->leave_sub(); bless $self, $type; } - 1;