From: Peter O. <obe...@us...> - 2010-12-16 08:11:30
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6305 Modified Files: genpng Log Message: genpng: handle empty source files Generating an overview PNG image for an empty source code file fails. Handle this case by assuming a single empty line when run for an empty source code file. Reported by: syl...@de... Index: genpng =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/genpng,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** genpng 19 Nov 2010 15:45:01 -0000 1.17 --- genpng 16 Dec 2010 08:11:22 -0000 1.18 *************** *** 239,243 **** my $tab_size = shift(@_); # Replacement string for tab signs my @source = @_; # Source code as passed via argument 2 ! my $height = scalar(@source); # Height as define by source size my $overview; # Source code overview image data my $col_plain_back; # Color for overview background --- 239,243 ---- my $tab_size = shift(@_); # Replacement string for tab signs my @source = @_; # Source code as passed via argument 2 ! my $height; # Height as define by source size my $overview; # Source code overview image data my $col_plain_back; # Color for overview background *************** *** 262,265 **** --- 262,270 ---- local *PNG_HANDLE; # Handle for output PNG file + # Handle empty source files + if (!@source) { + @source = ( "" ); + } + $height = scalar(@source); # Create image $overview = new GD::Image($overview_width, $height) |