From 754687fd75a226cb5a3a46d92b8c48e589a59a54 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 14 Feb 2009 16:31:42 -0500 Subject: Read and write in binary mode for everything. --- core/file_io.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/file_io.lua') diff --git a/core/file_io.lua b/core/file_io.lua index 7500667c..59017b64 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -76,7 +76,7 @@ end function reload(buffer) textadept.check_focused_buffer(buffer) if not buffer.filename then return end - local f, err = io.open(buffer.filename) + local f, err = io.open(buffer.filename, 'rb') if f then local pos = buffer.current_pos local first_visible_line = buffer.first_visible_line @@ -196,7 +196,7 @@ function load_session(filename, only_pm) local user_dir = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE') if not user_dir then return end local ta_session = user_dir..'/.ta_session' - local f = io.open(filename or ta_session) + local f = io.open(filename or ta_session, 'rb') local current_view, splits = 1, { [0] = {} } if f then for line in f:lines() do @@ -204,7 +204,7 @@ function load_session(filename, only_pm) if line:find('^buffer:') then local anchor, current_pos, first_visible_line, filename = line:match('^buffer: (%d+) (%d+) (%d+) (.+)$') - textadept.io.open(filename or '') + textadept.io.open(filename or '', 'rb') -- Restore saved buffer selection and view. local anchor = tonumber(anchor) or 0 local current_pos = tonumber(current_pos) or 0 @@ -314,7 +314,7 @@ function save_session(filename) local user_dir = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE') if not user_dir then return end local ta_session = user_dir..'/.ta_session' - local f = io.open(filename or ta_session, 'w') + local f = io.open(filename or ta_session, 'wb') if f then f:write(table.concat(session, '\n')) f:close() @@ -336,7 +336,7 @@ end -- @usage textadept.io.read_api_file(filename, '%w_') function read_api_file(filename, word_chars) local api = {} - local f = io.open(filename) + local f = io.open(filename, 'rb') if f then for line in f:lines() do local func, params, desc = -- cgit v1.2.3