Skip to content

Commit

Permalink
problems with [Fixnum, Fixnum] accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Jul 30, 2010
1 parent a5dcf98 commit cf04b15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/wiki/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def content(pos = nil, len = nil)
c.force_encoding(Encoding::BINARY) if !c.valid_encoding?
end
if pos
c[[[0, pos.to_i].max, c.size].min, [0, len.to_i].max]
start = [[0, pos.to_i].max, c.size].min
c[start ... start + [0, len.to_i].max]
else
c
end
Expand Down

0 comments on commit cf04b15

Please sign in to comment.