From: Richard Heck Date: Fri, 5 Nov 2010 01:03:30 +0000 (+0000) Subject: Make sure we don't go beyond the end of the lines. X-Git-Tag: 2.0.0~2019 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e0227fa3968d0e55f145fbb6937476c2f9f66bd4;p=features.git 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 --- diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py index 43ebcd091c..8db73c615a 100644 --- a/lib/lyx2lyx/parser_tools.py +++ b/lib/lyx2lyx/parser_tools.py @@ -46,7 +46,7 @@ def find_token(lines, token, start, end = 0, exact = False): Return -1 on failure.""" - if end == 0: + if end == 0 or end > len(lines): end = len(lines) m = len(token) for i in xrange(start, end):