Bugzilla – Bug 5848
Slim/Utils/Strings.pm too picky about plugins strings.txt line endings
Last modified: 2008-12-18 11:12:53 UTC
Converting some old code, SC7 complained about strings.txt for two plugins. The problem seemed to be that the plugins were originally written on Windows, so when I copied Plugin.pm and pared it down to make strings.txt, my strings.txt files had DOS line endings. Slim/Utils/Strings.pm uses chomp() to remove line endings (I'm not a fan of chomp) which leaves DOS \r at the end of strings when SC7 runs on Unix. I'd suggest something like the following (untested; I just used dos2unix to fix my files) -- with strings moving out of .pm files and developers on multiple platforms, SC7 shouldn't be so picky. --- Slim/Utils/Strings.pm (revision 13905) +++ Slim/Utils/Strings.pm (working copy) @@ -270,7 +270,7 @@ LINE: for my $line (split('\n', $$text)) { $ln++; - chomp($line); + $line =~ s/[\r\n]//g; next if $line =~ /^#/; next if $line !~ /\S/;
Michael, what is the feeling regarding relaxing the line ending requirement for strings files?
The other day I asked myself why not? Seems pretty obvious to me. Feel free to go ahead. Thanks!
done in change 15177. The spec for SS/SC code has always been unix line endings, and this remains so even for strings.txt files. However, this will allow those endings to be dos style and not cause total breakage of the parsing. reopen if there are any issues.
This bug is being closed since it was resolved for a version which is now released! Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html If you are still seeing this bug, please re-open it and we will consider it for a future release.