[Lxr-commits] CVS: lxr/lib/LXR Lang.pm,1.25,1.26
Brought to you by:
ajlittoz
|
From: Malcolm B. <mb...@us...> - 2002-01-23 08:12:36
|
Update of /cvsroot/lxr/lxr/lib/LXR
In directory usw-pr-cvs1:/tmp/cvs-serv4800
Modified Files:
Lang.pm
Log Message:
Fix bug 506627: Excessive memory usage. Rather than read the whole file into
memory to determine if it is a script, get a filehandle to it and retrieve the first line.
This may still mean the whole file ends up in memory "under the hood", depending on the
implementation of the individual backends, but with Plain.pm it doesn't.
Index: Lang.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Lang.pm 2001/11/28 13:01:57 1.25
+++ Lang.pm 2002/01/23 08:12:05 1.26
@@ -40,7 +40,8 @@
if (!defined $lang) {
# Try to see if it's a script
- $files->getfile($pathname, $release) =~ /^#!\s*(\S+)/s;
+ my $fh = $files->getfilehandle($pathname, $release);
+ $fh->getline =~ /^#!\s*(\S+)/s;
my $shebang = $1;
|