=== modified file 'lib/MySQLConfig.pm' --- lib/MySQLConfig.pm 2012-01-19 19:46:56 +0000 +++ lib/MySQLConfig.pm 2012-06-02 20:26:58 +0000 @@ -339,6 +339,7 @@ if ( $item ) { # Strip leading and trailing whitespace. $item =~ s/^\s+//; + $item =~ s/[#;].*$//; # trailing comment $item =~ s/\s+$//; } === modified file 't/lib/MySQLConfig.t' --- t/lib/MySQLConfig.t 2012-03-06 13:56:08 +0000 +++ t/lib/MySQLConfig.t 2012-06-02 20:06:33 +0000 @@ -9,7 +9,7 @@ use strict; use warnings FATAL => 'all'; use English qw(-no_match_vars); -use Test::More tests => 29; +use Test::More tests => 30; use MySQLConfig; use DSNParser; @@ -798,6 +798,18 @@ "innodb_file_per_table (mycnf-baron-002.cnf)" ); +$config = new MySQLConfig( + file => "$trunk/t/lib/samples/configs/mycnf-kc-001.txt", + TextResultSetParser => $trp, +); +is( + $config->value_of('user'), + 'mysql', + 'end of line comment in option file' +); + + + # ############################################################################# # Online test. # ############################################################################# === added file 't/lib/samples/configs/mycnf-kc-001.txt' --- t/lib/samples/configs/mycnf-kc-001.txt 1970-01-01 00:00:00 +0000 +++ t/lib/samples/configs/mycnf-kc-001.txt 2012-06-02 20:05:37 +0000 @@ -0,0 +1,2 @@ +[mysqld] +user=mysql ; comment