X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FInifile.pm;h=846459d5f5a372a8aecb112a0baa57cecb924664;hb=c19f41e1e0b92c7721963e0b40797b257bc88b3e;hp=f7fe27b3c60fd7afa3c0bdee0a6f616f97dc663b;hpb=db53dc8ab328b82c7af17896487674ad98f2af6b;p=kivitendo-erp.git diff --git a/SL/Inifile.pm b/SL/Inifile.pm index f7fe27b3c..846459d5f 100644 --- a/SL/Inifile.pm +++ b/SL/Inifile.pm @@ -38,9 +38,9 @@ package Inifile; use IO::File; sub new { - $main::lxdebug->enter_sub(); + $main::lxdebug->enter_sub(2); - my ($type, $file) = @_; + my ($type, $file, %options) = @_; my $id = ""; my $skip; @@ -52,16 +52,18 @@ sub new { open FH, "$file" or Form->error("$file : $!"); while () { - next if m/^(#|;|\s)/; - chomp; - # strip comments - s/(#|;).*//g; + if (!$options{verbatim}) { + # strip comments + s/\#.*//; - # remove any trailing whitespace - s/^\s*//; - s/\s*$//; + # remove any trailing whitespace + s/^\s*//; + s/\s*$//; + } else { + next if (m/^\s*\#/); + } next unless $_; @@ -86,7 +88,7 @@ sub new { } close FH; - $main::lxdebug->leave_sub(); + $main::lxdebug->leave_sub(2); return bless $self, $type; }