Subject: | 2 small Devel::REPL::Plugin::CompletionDriver::INC issues |
Date: | Sun, 18 Jan 2009 23:24:01 +0100 |
To: | bug-Devel-REPL [...] rt.cpan.org |
From: | Stoned Elipot <seb [...] univ-paris-diderot.fr> |
Hi,
With Devel-REPL-1.003001, using perl
"This is perl, v5.10.0 built for darwin-thread-multi-2level"
running Darwin 9.6.0 i386
I'm seeing 2 small issue with the module
Devel::REPL::Plugin::CompletionDriver::INC.
- It uses File::Next when Devel::REPL's Makefile.PL does not say
so. See proposed patch in attached file patch-aa
- Devel::REPL::Plugin::CompletionDriver::INC calls opendir() and
then calls readdir() without checking if opendir() encountered
and error. So for example if @INC "contains" an inexistent directory
or a plain file readdir() error messages are displayed when
Devel::REPL::Plugin::CompletionDriver::INC is triggered for completion.
For example:
:;PERL5LIB=/etc/passwd re.pl --rcfile /dev/null
$ $_REPL->load_plugin('CompletionDriver::INC')
1
$ use Mreaddir() attempted on invalid dirhandle at
/usr/pkg/lib/perl5/vendor_perl/5.10.0/Devel/REPL/Plugin/CompletionDriver/INC.pm
line 80.
readdir() attempted on invalid dirhandle at
/usr/pkg/lib/perl5/vendor_perl/5.10.0/Devel/REPL/Plugin/CompletionDriver/INC.pm
line 80.
Display all 229 possibilities? (y or n)
Tab was typed after 'use M' on the second command line and my perl's
default @INC happens to contains an inexistent directory hence
the two readdir() error messages.
Attached in file patch-ab is my proposal to fix this.
Cheers, Stoned.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.