git.shiar.nl
/
perl
/
list-index.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test ranges distribution
[perl/list-index.git]
/
lib
/
List
/
Index.pm
diff --git
a/lib/List/Index.pm
b/lib/List/Index.pm
index 5b46313d7272168dea172ddf5135ce9ef480dae0..4a2118910cf3708c11ada4bc07644930a33f3486 100644
(file)
--- a/
lib/List/Index.pm
+++ b/
lib/List/Index.pm
@@
-28,9
+28,9
@@
sub ranges {
while ($offset < @$self) {
my $link = substr $self->[$offset], 0, $length;
if ($context) {
while ($offset < @$self) {
my $link = substr $self->[$offset], 0, $length;
if ($context) {
- {
+
if ($offset > $context - 1)
{
# take a value slightly before the current offset
# take a value slightly before the current offset
- my $before = $
offset > $context ? $self->[$offset - $context] : '.'
;
+ my $before = $
self->[$offset - $context - 1]
;
# see how much of it matches the current link
my $trim = 1;
for my $match (split //, $before) {
# see how much of it matches the current link
my $trim = 1;
for my $match (split //, $before) {