]> git.lyx.org Git - features.git/commitdiff
Make sure we don't go beyond the end of the lines.
authorRichard Heck <rgheck@comcast.net>
Fri, 5 Nov 2010 01:03:30 +0000 (01:03 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 5 Nov 2010 01:03:30 +0000 (01:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36096 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/parser_tools.py

index 43ebcd091c3d90625e483bed50fd3a408014ab04..8db73c615a62af449561467fb127b841454e15b4 100644 (file)
@@ -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):