From 24079f744f425a16c0d03b418f2b5121293abb99 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Sat, 8 Dec 2018 16:00:08 +0000 Subject: Shorten 'cat_file' function using Penlight's file.read. --- telem.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/telem.lua b/telem.lua index b73c275..91916fd 100755 --- a/telem.lua +++ b/telem.lua @@ -26,10 +26,7 @@ current_post_index = nil -- Integer index into current_thread_posts -- Utility functions function cat_file(filename) - io.input(filename) - contents = io.read("*all") - io.input(io.stdin) - io.write(contents) + io.write(file.read(filename)) end function getchar() -- cgit v1.2.3