Skip Menu |

This queue is for tickets about the Config-IniFiles CPAN distribution.

Report information
The Basics
Id: 17431
Status: resolved
Priority: 0/
Queue: Config-IniFiles

People
Owner: Nobody in particular
Requestors: SAPER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.39
Fixed in: (no value)



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
This is kinda a pre-duplicate of https://rt.cpan.org/Ticket/Display.html?id=43843 which was resolved now thank to a patch by Peter Xu.