From 25adb8e7568b748a08f3106fcd30ac81e8cf0d6f Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 27 Aug 2009 13:03:39 +0200 Subject: [PATCH] Make pret-trans complain on invalid input. Before, the lua would just crash with a vague error. --- pret-trans.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pret-trans.lua b/pret-trans.lua index ac1b525..238a4e5 100644 --- a/pret-trans.lua +++ b/pret-trans.lua @@ -91,7 +91,11 @@ function vis.end_of_display() break end end - + + if not len then + error("No horizontal separator found in:\n" .. table.concat(lines, "\n")) + end + -- Split the input in three parts. Stuff before the line, stuff -- after the line, stuff to the right of the line. before, after, rights = {}, {}, {} -- 2.30.2