[Lxr-dev] [ lxr-Bugs-565811 ] unreadable files can terminate genxref
Brought to you by:
ajlittoz
From: <no...@so...> - 2002-06-07 13:25:15
|
Bugs item #565811, was opened at 2002-06-07 13:25 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=390117&aid=565811&group_id=27350 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Gregor Hartmann (grex) Assigned to: Nobody/Anonymous (nobody) Summary: unreadable files can terminate genxref Initial Comment: When an unreadable file is encountered whos language cannot be determined by the filename the file is opened to see if it is a script. The file is opened using FileHandle to read the first line. however if new FileHandle fails, this is not checked and getline terminates the program with following error: Can't call method "getline" on an undefined value at lib/LXR/Lang.pm line 47. I changed some lines in lib/LXR/Lang.pl to fix this. The files are then treated as if no language was found. I Added two lines of context above and below starting at line 41 in lib/LXR/Lang.pl if (!defined $lang) { # Try to see if it's a script my $shebang; my $fh = $files->getfilehandle($pathname, $release); if ( 1 ) { $fh->getline =~ /^\#!\s*(\S+)/s; $shebang = $1; } else { $shebang = ""; } my %filetype = %{$config->filetype}; my %inter = %{$config->interpreters}; ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=390117&aid=565811&group_id=27350 |