X-Git-Url: http://git.shiar.net/gitweb.cgi/perl/list-index.git/blobdiff_plain/f5f900c433ee5247b0466d0e3efcd3f66ff664d9..5d1c609f28d64e60c9595c9a207b8d19e823b122:/lib/List/Index.pm?ds=inline diff --git a/lib/List/Index.pm b/lib/List/Index.pm index 9c86bc3..23ab261 100644 --- a/lib/List/Index.pm +++ b/lib/List/Index.pm @@ -43,7 +43,7 @@ sub ranges { for my $i (0 .. $#links - 1) { my ($link, $lastchar) = $links[$i + 1]->[0] =~ /(.*)(.)/; - $link .= $lastchar eq '.' ? 'z' : chr( ord($lastchar) - 1 ) + $link .= $lastchar eq '.' ? 'a' : chr( ord($lastchar) - 1 ) unless $lastchar eq 'a'; $links[$i]->[1] = $link; } @@ -90,7 +90,7 @@ sub rangematch { if (length $s1 > $i) { my $c1 = substr $s1, $i, 1; if ($s1 =~ /^\Q$prefix/) { - next if $c1 eq $char; + next if $c1 le $char; } } push @allow, $prefix."(?![$char-$last])"