Subject: | [patch] Remove inline comments from values |
Hello,
Config::IniFiles is incorrectly including comments on the same line
as a parameter definition in the parameter value. For example, I was
trying to read a php.ini that contains lines like:
max_execution_time = 30 ; Maximum execution time of each script, in
seconds
Config::Inifiles puts the value "30 ; Maximum execution time of each
script, in seconds" for max_execution_time, instead of just "30".
The attached patch fixes this.
--
Close the world, txEn eht nepO.
Subject: | Config-IniFiles-0.39-inline-comments.patch |
--- IniFiles.pm.orig 2005-04-29 21:38:56.000000000 +0200
+++ IniFiles.pm 2006-02-02 11:02:17.246478030 +0100
@@ -639,6 +639,9 @@
while ( @lines ) {
$_ = shift @lines;
+ if (s/\s*[$allCmt](.*)$//) { # collect inline comments
+ push(@cmts, $1);
+ }
s/(\015\012?|\012|\025|\n)$//; # remove line ending char(s)
$lineno++;
if (/^\s*$/) { # ignore blank lines