Merge branch 'master-MC1.10' into master-MC1.12

# Conflicts:
#	gradle/wrapper/gradle-wrapper.properties
#	src/main/resources/assets/opencomputers/lang/ru_RU.lang
This commit is contained in:
payonel 2020-01-25 17:12:06 -08:00
commit e9f92e0646
4 changed files with 6 additions and 10 deletions

View File

@ -2,6 +2,7 @@ sudo: false
language: scala
scala: 2.11.1
jdk: oraclejdk8
dist: trusty
notifications:
email: false

View File

@ -181,7 +181,7 @@ function text.internal.reader(txt, mode)
}, {__index=text.internal.stream_base((mode or ""):match("b"))})
process.closeOnExit(reader)
return require("buffer").new("r", reader)
return require("buffer").new((mode or "r"):match("[rb]+"), reader)
end
function text.internal.writer(ostream, mode, append_txt)
@ -223,7 +223,7 @@ function text.internal.writer(ostream, mode, append_txt)
}, {__index=text.internal.stream_base((mode or ""):match("b"))})
process.closeOnExit(writer)
return require("buffer").new("w", writer)
return require("buffer").new((mode or "w"):match("[awb]+"), writer)
end
function text.detab(value, tabWidth)

View File

@ -47,17 +47,12 @@ end
function io.stream(fd,file,mode)
checkArg(1,fd,'number')
checkArg(2, file, "table", "string", "nil")
assert(fd>=0,'fd must be >= 0. 0 is input, 1 is stdout, 2 is stderr')
local dio = require("process").info().data.io
if file then
if type(file) == "string" then
local result, reason = io.open(file, mode)
if not result then
error(reason, 2)
end
file = result
elseif not io.type(file) then
error("bad argument #1 (string or file expected, got " .. type(file) .. ")", 2)
file = assert(io.open(file, mode))
end
dio[fd] = file
end

View File

@ -54,7 +54,7 @@ local function checkDeadline()
end
local function pcallTimeoutCheck(...)
local ok, timeout = ...
if timeout == tooLongWithoutYielding then
if rawequal(timeout, tooLongWithoutYielding) then
return ok, tostring(tooLongWithoutYielding)
end
return ...