Fix order of arguments in 'open'

Since they were wrong in two places, there is no API changes, just a
readability fix.
This commit is contained in:
Alexandre Erwin Ittner 2010-11-17 12:43:33 -02:00
parent e9f3a5e377
commit 30fdc3c192

View File

@ -7,10 +7,9 @@ local m = { }
local mti = { } local mti = { }
local mt = { __index = mti } local mt = { __index = mti }
function m.open(fname, mode, fromcharset, tocharset) function m.open(fname, mode, tocharset, fromcharset)
assert(mode == "r" or mode == "rb", "Only read modes are supported yet") assert(mode == "r" or mode == "rb", "Only read modes are supported yet")
tocharset = tocharset or "utf8" local cd = assert(iconv.new(tocharset, fromcharset), "Bad charset")
local cd = assert(iconv.new(fromcharset, tocharset), "Bad charset")
local fp = io.open(fname, mode) local fp = io.open(fname, mode)
if not fp then if not fp then
return nil return nil