Skip Menu |

This queue is for tickets about the Term-ReadLine-Gnu CPAN distribution.

Maintainer(s)' notes

When you report a bug, please provide the following information;

- output of
	perl -V
	perl Makefile.PL verbose
	make test TEST_VERBOSE=1
	perl -Mblib t/00checkver.t
	echo $TERM
- terminal emulator which you are using
- compiler which is used to compile the GNU Readline Library (libreadline.a) if you can know.
Read INSTALL in the distribution for more details.

Report information
The Basics
Id: 72378
Status: resolved
Priority: 0/
Queue: Term-ReadLine-Gnu

People
Owner: HAYASHI [...] cpan.org
Requestors: cjm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.20
Fixed in: 1.27



Subject: [PATCH] Allow case-insensitive completion
I asked in http://stackoverflow.com/q/8070012/8355 why I couldn't get Term::ReadLine::Gnu to do case-insensitive completion. It turns out that Term::ReadLine::Gnu::XS::_trp_completion_function is performing a case-sensitive filter on the results. I'm not sure why. The attached patch fixes this issue and makes Term::ReadLine::Gnu behave like Term::ReadLine::Perl. The test script on StackOverflow may be useful in confirming that.
Subject: completion.patch
--- Term/ReadLine/Gnu/XS.pm$ 2011-11-09 12:06:33.077031863 -0600 +++ Term/ReadLine/Gnu/XS.pm 2011-11-11 19:59:21.008707489 -0600 @@ -579,10 +579,7 @@ return undef unless defined $_matches[0]; } - for (; $_i <= $#_matches; $_i++) { - return $_matches[$_i] if ($_matches[$_i] =~ /^\Q$text/); - } - return undef; + return $_matches[$_i]; } 1;
Hi, Thank you for your report. This bug has been existing since I implemented the function in 1999. http://perl-trg.svn.sourceforge.net/viewvc/perl-trg/trunk/Gnu/XS.pm?r1=233&r2=245 I'll include your fix on the next release.
I put your fix in 1.21. Thanks.
I've found that the fix contributed was wrong. Here is the correct fix. @@ -580,7 +584,10 @@ } for (; $_i <= $#_matches; $_i++) { - return $_matches[$_i] if ($_matches[$_i] =~ /^\Q$text/); + # case insensitive match to be compatible with + # Term::ReadLine::Perl. + # https://rt.cpan.org/Ticket/Display.html?id=72378 + return $_matches[$_i] if ($_matches[$_i] =~ /^\Q$text/i); } return undef; } It will be included in the next release.
The fix is in 1.27.