Subject: | [patch] Remove inline comments from values |
Hello,
Config::Tiny 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
Config::Tiny puts the value "30 ; Maximum execution time of each
script" for max_execution_time, instead of just "30".
The attached patch fixes this.
--
Close the world, txEn eht nepO.
Subject: | Config-Tiny-2.04-inline-comments.patch |
--- lib/Config/Tiny.pm.orig 2006-02-02 11:24:26.449656447 +0100
+++ lib/Config/Tiny.pm 2006-02-02 11:28:36.015354001 +0100
@@ -48,6 +48,9 @@
# Skip comments and empty lines
next if /^\s*(?:\#|\;|$)/;
+ # Remove inline comments
+ s/\s*[#;].*$//;
+
# Handle section headers
if ( /^\s*\[\s*(.+?)\s*\]\s*$/ ) {
# Create the sub-hash if it doesn't exist.