diff options
author | Solderpunk <solderpunk@sdf.org> | 2018-12-08 16:00:08 +0000 |
---|---|---|
committer | Solderpunk <solderpunk@sdf.org> | 2018-12-08 16:00:08 +0000 |
commit | 24079f744f425a16c0d03b418f2b5121293abb99 (patch) | |
tree | 0a0dc9d200a50950d6f1dde45a20240964d58c85 | |
parent | Gracefully handle empty lines. (diff) |
Shorten 'cat_file' function using Penlight's file.read.
Diffstat (limited to '')
-rwxr-xr-x | telem.lua | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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() |