Skip to content

Commit c150373

Browse files
committed
fix bug to do with "buffy -test" not showing modules
1 parent 92bf89b commit c150373

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Revision history for Perl module CPAN::Mini::Webserver:
33
0.44
44
- autogenerate the CSS and Images template files
55
- use Text::Unidecode so that searching for Leon Brocard works
6+
- fix bug to do with "buffy -test" not showing modules
67

78
0.43 Thu Sep 18 17:14:50 BST 2008
89
- add an abstract to the Makefile.PL

TODO

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Reload indexes if the indexes have updated
77

88
Maybe use LWP::Online and gravatar?
99

10-
buffy -test should show modules too
11-
1210
Ideas from Max Maischein:
1311

1412
- (general)

lib/CPAN/Mini/Webserver.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,16 @@ sub _do_search {
285285
my $au_type = $self->author_type;
286286
my ( @authors, @distributions, @packages );
287287

288-
if ( $q !~ /(?:::|-)/ ) {
288+
if ( $q !~ /\w(?:::|-)\w/ ) {
289289
@authors = uniq grep { ref($_) eq "Parse::CPAN::${au_type}::Author" }
290290
@results;
291291
}
292-
if ( $q !~ /::/ ) {
292+
if ( $q !~ /\w::\w/ ) {
293293
@distributions
294294
= uniq grep { ref($_) eq 'Parse::CPAN::Packages::Distribution' }
295295
@results;
296296
}
297-
if ( $q !~ /-/ ) {
297+
if ( $q !~ /\w-\w/ ) {
298298
@packages = uniq grep { ref($_) eq 'Parse::CPAN::Packages::Package' }
299299
@results;
300300
}

0 commit comments

Comments
 (0)