From b4a16205f3903c0d4914c7160d6861cb845a210d Mon Sep 17 00:00:00 2001 From: kaeza Date: Thu, 24 Oct 2013 16:49:36 -0200 Subject: [PATCH] Fix signs_lib on Windows. It seems `io.open' by default opens files as text, which fails on Windows when the file is a binary file. This prevented signs_lib from opening the texture files and get the font size, which resulted in an error. --- signs_lib.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/signs_lib.lua b/signs_lib.lua index 0ac301c..1319eb9 100644 --- a/signs_lib.lua +++ b/signs_lib.lua @@ -60,7 +60,7 @@ local function check_random_chars() for i = 1, 5 do local c = math.random(32, 126) local filename = FONT_FMT:format(TP, c) - local f = io.open(filename) + local f = io.open(filename, "rb") -- File does not exist (or cannot be read, or ...). -- Just assume it's different. @@ -146,7 +146,7 @@ local function build_char_db() for c = 32, 126 do local filename = FONT_FMT:format(TP, c) - local f = io.open(filename) + local f = io.open(filename, "rb") if f then local ch = string.char(c) local w, h = read_png_size(f)