Make sure we don't go beyond the end of the lines.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36096 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-11-05 01:03:30 +00:00
parent 7529918b08
commit e0227fa396

View File

@ -46,7 +46,7 @@ def find_token(lines, token, start, end = 0, exact = False):
Return -1 on failure.""" Return -1 on failure."""
if end == 0: if end == 0 or end > len(lines):
end = len(lines) end = len(lines)
m = len(token) m = len(token)
for i in xrange(start, end): for i in xrange(start, end):