From ef4207a7f6d85f2a33fa1889299dedc2270df856 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 1 Nov 2024 01:13:57 +0000 Subject: posix bug --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 593e917..abd0f2f 100644 --- a/init.lua +++ b/init.lua @@ -4,13 +4,14 @@ local prose = require'garkup.prose' function empipe(prog, input) local posix = require'posix' + local unistd = posix.unistd or require'posix.unistd' local pipe = assert(posix.popen_pipeline({ function() io.write(input) end, prog }, "r")) local output = "" repeat - local next = assert(posix.unistd.read(pipe.fd, 8192)) + local next = assert(unistd.read(pipe.fd, 8192)) output = output .. next until #next == 0 assert(posix.pclose(pipe)) -- cgit v1.2.3