From 6ba7ae0bd8e85fb1446bbf3a97557807c716414e Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Thu, 3 Aug 2023 20:46:50 +0200 Subject: [PATCH] fix file:close signature since Lua 5.2, when closing a file handle created with io.popen, file:close returns the same values returned by os.execute. --- tl.lua | 2 +- tl.tl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tl.lua b/tl.lua index 61a3a854..ccaa6e51 100644 --- a/tl.lua +++ b/tl.lua @@ -5227,7 +5227,7 @@ local function init_globals(lax) typename = "record", is_userdata = true, fields = { - ["close"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE }), rets = TUPLE({ BOOLEAN, STRING }) }), + ["close"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE }), rets = TUPLE({ BOOLEAN, STRING, INTEGER }) }), ["flush"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE }), rets = TUPLE({}) }), ["lines"] = a_type({ typename = "function", args = VARARG({ NOMINAL_FILE, a_type({ typename = "union", types = { STRING, NUMBER } }) }), rets = TUPLE({ a_type({ typename = "function", args = TUPLE({}), rets = VARARG({ STRING }) }), diff --git a/tl.tl b/tl.tl index 54082ee9..c64e04e7 100644 --- a/tl.tl +++ b/tl.tl @@ -5227,7 +5227,7 @@ local function init_globals(lax: boolean): {string:Variable}, {string:Type} typename = "record", is_userdata = true, fields = { - ["close"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE }, rets = TUPLE { BOOLEAN, STRING} }, + ["close"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE }, rets = TUPLE { BOOLEAN, STRING, INTEGER } }, ["flush"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE }, rets = TUPLE {} }, ["lines"] = a_type { typename = "function", args = VARARG { NOMINAL_FILE, a_type { typename = "union", types = { STRING, NUMBER } } }, rets = TUPLE { a_type { typename = "function", args = TUPLE {}, rets = VARARG { STRING } },