#59 unreadable files can terminate genxref !! includes FIX

v0.9.1
closed-fixed
nobody
5
2002-07-29
2002-06-07
No

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};

Discussion

  • Gregor Hartmann

    Gregor Hartmann - 2002-06-07
    • labels: --> Lang support
    • milestone: --> v0.9.1
     
  • Gregor Hartmann

    Gregor Hartmann - 2002-06-07
    • summary: unreadable files can terminate genxref --> unreadable files can terminate genxref !! includes FIX
     
  • Gregor Hartmann

    Gregor Hartmann - 2002-06-07

    Logged In: YES
    user_id=559509

    that should be a
    if ( $fh )
    instead of
    if ( 1 )
    of course up there

     
  • Malcolm Box

    Malcolm Box - 2002-07-29
    • status: open --> closed-fixed
     
  • Malcolm Box

    Malcolm Box - 2002-07-29

    Logged In: YES
    user_id=215386

    Fixed in current CVS

     
  • Nobody/Anonymous

    Logged In: NO

    Hi,

    How can unreadable/invisible files be excluded from index
    generation completely?. I have integrated LXR with config'n
    management system, ClearCase, which used views which filters
    what files/dirs (elements) that applied. The problem is that
    these files/dirs are still included in mysql index
    generation. In LXR release 0.9.1, I also made fixes to make
    genxref able to generate versions with such unreadable
    files. However, did not manage to exclude such entries
    completely.

    How about you - any suggestions/fixes?

    See below for an example

    BR Sverre Torjussen (Ericsson/Norway)
    > It seems as though 'invisible' files/dirs (or nonexisting
    not just not
    > readable as in this case) are still presented in
    lxr0.9.2. Here is an
    > example.
    >
    > (root) krem:/space/lxr/src_root>ls -l
    /view/lxr_CRH109338_LAST1/clearcase/semafor/GR_FuncBlocks_002/cnh160583_ip
    >
    /view/lxr_CRH109338_LAST1/clearcase/semafor/GR_FuncBlocks_002/cnh160583_ip/doc:
    No such file or directory
    > total 3
    > -r--r--r-- 1 etomvs eto-semafor 228 May 3 17:56
    1551_cnh160583.cfg
    > drwxrwxrwx 2 etohajn eto-semafor 27 May 3 17:55
    config
    > drwxrwxrwx 2 etohajn eto-semafor 30 May 3 17:55
    includeg
    >
    > In this case, the 'doc' dir is still presented by lxr.
    >
    > How can this be excluded?
    >

     

Log in to post a comment.