1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-15 11:45:42 +00:00

Make mode from io.open() accept nil

This commit is contained in:
Wilma456 (Jakob0815) 2017-09-06 18:53:44 +02:00 committed by GitHub
parent 369be7c32c
commit a5bbed528d

View File

@ -68,7 +68,7 @@ function open( _sPath, _sMode )
if _G.type( _sPath ) ~= "string" then if _G.type( _sPath ) ~= "string" then
error( "bad argument #1 (expected string, got " .. _G.type( _sPath ) .. ")", 2 ) error( "bad argument #1 (expected string, got " .. _G.type( _sPath ) .. ")", 2 )
end end
if _G.type( _sMode ) ~= "string" then if _sMode ~= nil and _G.type( _sMode ) ~= "string" then
error( "bad argument #2 (expected string, got " .. _G.type( _sMode ) .. ")", 2 ) error( "bad argument #2 (expected string, got " .. _G.type( _sMode ) .. ")", 2 )
end end
local sMode = _sMode or "r" local sMode = _sMode or "r"