Skip Menu |
 

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

Report information
The Basics
Id: 68913
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Config-Auto

People
Owner: BINGOS [...] cpan.org
Requestors: alim [...] gmx.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.34
Fixed in: (no value)



Subject: config files with DOS line endings do not work in Linux
Well, I noticed it with DOS line endings but the problem occurs with any trailing whitespace (at least) with the 'equal' format. In line 662f there is this code to separate keys and values: next unless /^\s*(.*?)\s*=\s*(.*)\s*$/; my ($k, $v) = ($1, $2); Problem is, the second parentheses is greedy, so the optional \s* at the end will never have any effect and all trailing whitespace (including the additional DOS line ending character) gets into $2 and $v. Because of the \s*$ I suspect this effect is not intentional, ergo a bug. But it is easy to fix, either by not making it greedy: next unless /^\s*(.*?)\s*=\s*(.*?)\s*$/; # additional question mark or with an additional trim: $v =~ s/\s+$//; It is very difficult to work around the problem by making sure there is no trailing whitespace since, well it is "white" and invisible. I am not sure if I understand what the intent of the second alternative elsif ($v =~ /\s/) {...} is that is triggered by the above bug because there is whitespace left in $v but it also looks suspicious that the resulting @v is not used. -Michael
Thanks for the ticket. I have resolved the issue and released 0.36 to CPAN today. Many thanks.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.