[Lxr-commits] CVS: lxr genxref,1.37,1.38
Brought to you by:
ajlittoz
From: Malcolm B. <mb...@us...> - 2009-03-23 16:51:24
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv369 Modified Files: genxref Log Message: Fix bug [ 1691391 ] genxref/swish-e/binary files is VERY inefficient Patched as per bug report - use filehandle to determine binary-ness, not the whole contents. Index: genxref =================================================================== RCS file: /cvsroot/lxr/lxr/genxref,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- genxref 2 Nov 2005 23:39:55 -0000 1.37 +++ genxref 23 Mar 2009 16:51:19 -0000 1.38 @@ -131,10 +131,11 @@ $files->getdir($pathname, $release); } else { print $filelist "$pathname\n"; - my $contents = $files->getfile($pathname, $release); - if ($filetype->checktype_contents($contents) =~ m%(text|message)/% - and length($contents) > 0) + my $fh = $files->getfilehandle($pathname, $release); + if ($files->getfilesize($pathname, $release) > 0 + && $filetype->checktype_filehandle($fh) =~ m%(text|message)/%) { + my $contents = $files->getfile($pathname, $release); $swish->print( "Path-Name: $pathname\n", "Content-Length: " . length($contents) . "\n", @@ -144,6 +145,7 @@ } else { $binaryfiles{$pathname} = 1; } + close($fh); } } |