Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2012-01-21 11:06:26 +0400
committerMark Pulford <mark@kyne.com.au>2012-03-04 12:24:35 +0400
commitb77481ff100be4710419713d20faf3b8e1531ea2 (patch)
tree769c46b2e2dd97e12ab0ad52506c1044c074efae
parent78e71e1f4e15a9f37d83fb71871c1c4f7c85a424 (diff)
Force binary file mode in util.lua
Force binary file mode in util.lua to fix the utf8.dat test under Windows.
-rw-r--r--lua/cjson/util.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/cjson/util.lua b/lua/cjson/util.lua
index 79245b5..6916dad 100644
--- a/lua/cjson/util.lua
+++ b/lua/cjson/util.lua
@@ -98,7 +98,7 @@ local function file_load(filename)
file = io.stdin
else
local err
- file, err = io.open(filename)
+ file, err = io.open(filename, "rb")
if file == nil then
error(("Unable to read '%s': %s"):format(filename, err))
end
@@ -122,7 +122,7 @@ local function file_save(filename, data)
file = io.stdout
else
local err
- file, err = io.open(filename, "w")
+ file, err = io.open(filename, "wb")
if file == nil then
error(("Unable to write '%s': %s"):format(filename, err))
end