From 2dd673e4d322e0fbb53c45abb5cee6533f20c1b1 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Sun, 4 Mar 2012 21:44:31 +0000 Subject: [PATCH] Fix past end of string bug in Python first line hack. --- abcfirstline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abcfirstline.py b/abcfirstline.py index 26a5daa..ab6ccb0 100755 --- a/abcfirstline.py +++ b/abcfirstline.py @@ -11,7 +11,7 @@ def process(inf): for line in inf: line = line.strip() start = line[:2] - if start[0] != "|" and start[1] == ":": + if len(start) > 1 and start[0] != "|" and start[1] == ":": if start[0] in ["M", "K", "L"]: print line elif start[0] != "%":