diff options
author | 2009-02-14 16:31:42 -0500 | |
---|---|---|
committer | 2009-02-14 16:31:42 -0500 | |
commit | 754687fd75a226cb5a3a46d92b8c48e589a59a54 (patch) | |
tree | 9e2f716a1f90533205d3dacd54606d4a648a01f5 /core/ext/pm | |
parent | 6fc95cc3a1df42d81f24d1a912bcaec952db62d4 (diff) | |
download | textadept-754687fd75a226cb5a3a46d92b8c48e589a59a54.tar.gz textadept-754687fd75a226cb5a3a46d92b8c48e589a59a54.zip |
Read and write in binary mode for everything.
Diffstat (limited to 'core/ext/pm')
-rw-r--r-- | core/ext/pm/ctags_browser.lua | 4 | ||||
-rw-r--r-- | core/ext/pm/modules_browser.lua | 6 | ||||
-rw-r--r-- | core/ext/pm/project_browser.lua | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/core/ext/pm/ctags_browser.lua b/core/ext/pm/ctags_browser.lua index 7039d1c4..01f8cc12 100644 --- a/core/ext/pm/ctags_browser.lua +++ b/core/ext/pm/ctags_browser.lua @@ -117,13 +117,13 @@ function get_contents_for(full_path, expanding) current_file = nil current_dir = '' -- ctags file will specify absolute paths os.execute('ctags -f '..FILE_OUT..' '..(buffer.filename or '')) - f = io.open(FILE_OUT) + f = io.open(FILE_OUT, 'rb') if not f then return {} end elseif not expanding then tags = {} current_file = ctags_file current_dir = ctags_file:match('^.+/') -- ctags file dirname - f = io.open(ctags_file) + f = io.open(ctags_file, 'rb') if not f then return {} end else local parent = tags diff --git a/core/ext/pm/modules_browser.lua b/core/ext/pm/modules_browser.lua index 2fbef945..fada137b 100644 --- a/core/ext/pm/modules_browser.lua +++ b/core/ext/pm/modules_browser.lua @@ -141,17 +141,17 @@ function perform_menu_action(menu_id, selected_item) local module_dir = _HOME..'/modules/'..module_name if lfs.mkdir(module_dir) then -- write init.lua from template - local f = io.open(module_dir..'/init.lua', 'w') + local f = io.open(module_dir..'/init.lua', 'wb') local out = INIT:gsub('$1', module_name):gsub('$2', lang_name) f:write(out) f:close() -- write snippets.lua from template - f = io.open(module_dir..'/snippets.lua', 'w') + f = io.open(module_dir..'/snippets.lua', 'wb') out = SNIPPETS:gsub('$1', module_name):gsub('$2', lang_name) f:write(out) f:close() -- write commands.lua from template - f = io.open(module_dir..'/commands.lua', 'w') + f = io.open(module_dir..'/commands.lua', 'wb') out = COMMANDS:gsub('$1', module_name):gsub('$2', lang_name) f:write(out) f:close() diff --git a/core/ext/pm/project_browser.lua b/core/ext/pm/project_browser.lua index 30616ef9..f034e41c 100644 --- a/core/ext/pm/project_browser.lua +++ b/core/ext/pm/project_browser.lua @@ -179,7 +179,7 @@ function perform_menu_action(menu_id, selected_item) if ret == '3' then return end end end - local f = io.open(file, 'w') + local f = io.open(file, 'wb') f:write('') f:close() update_project() @@ -412,7 +412,7 @@ end -- Sets the local 'project_file' and 'project' fields appropriately. -- @param file The project file. load_project = function(file) - local f = io.open(file) + local f = io.open(file, 'rb') project_root = loadstring('return '..f:read('*all'))() f:close() project_file = file @@ -436,7 +436,7 @@ update_project = function() end end end - local f = io.open(project_file, 'w') + local f = io.open(project_file, 'wb') f:write('{\n') write_folder(project_root, f) f:write('}') |