Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 523610 - app-text/code2html-0.9.1-r1 - length() used on @lines (did you mean "scalar(@lines)"?) at ./code2html line 13[67]0.
Summary: app-text/code2html-0.9.1-r1 - length() used on @lines (did you mean "scalar(@...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-09-24 12:09 UTC by groepaz
Modified: 2014-12-07 17:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to fix the warnings (code2html-fix-warnings.patch,1.40 KB, patch)
2014-09-24 12:12 UTC, groepaz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description groepaz 2014-09-24 12:09:57 UTC
each time code2html runs it emits warnings like this:

length() used on @lines (did you mean "scalar(@lines)"?) at ./code2html line 1360.
length() used on @lines (did you mean "scalar(@lines)"?) at ./code2html line 1370.

this warning was recently introduced in perl, and since code2html is no more actively maintained it would be nice to see it fixed/patched in the ebuild.

here is the patch:

--- code2html.orig      2002-01-12 22:17:02.000000000 +0100                                                                                                                        
+++ code2html   2014-09-24 13:52:52.000000000 +0200                                                                                                                                
@@ -1357,7 +1357,7 @@                                                                                                                                                              
                                                                   my @lines = split ( /\n/, $_[0] );                                                                              
                                                                                                                                                                                   
                                                                    my $nr = 0;                                                                                                    
-                                                                   my $lengthofnr = length(@lines);                                                                               
+                                                                   my $lengthofnr = length(scalar(@lines));                                                                       
                                                                    my $format = qq{<a name="$_[1]line%u">%${lengthofnr}u</a> %s\n} ;                                              
                                                                   join ('', map (  {$nr++; sprintf ( $format , $nr, $nr, $_ )} @lines));                                          
                                                                   },                                                                                                              
@@ -1367,7 +1367,7 @@                                                                                                                                                              
                                                                   my @lines = split ( /\n/, $_[0] );                                                                              
                                                                                                                                                                                   
                                                                    my $nr = 0;                                                                                                    
-                                                                   my $lengthofnr = length(@lines);                                                                               
+                                                                   my $lengthofnr = length(scalar(@lines));                                                                       
                                                                    my $format = qq{<a name="$_[1]line%u" href="#$_[1]line%u">%$ {lengthofnr}u</a> %s\n};                          
                                                                    join ('', map (  {$nr++; sprintf ( $format , $nr, $nr, $nr, $_ )} @lines));
                                                                   }


Reproducible: Always
Comment 1 groepaz 2014-09-24 12:12:27 UTC
Created attachment 385386 [details, diff]
patch to fix the warnings

ugh, that turned out ugly, so here is the patch again
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2014-12-07 17:17:53 UTC
Fixed in 0.9.1-r2, thanks!