summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-11-01 01:13:57 +0000
committerubq323 <ubq323@ubq323.website>2024-11-01 01:14:42 +0000
commitef4207a7f6d85f2a33fa1889299dedc2270df856 (patch)
tree22d4c12ce3ed9cfb9e1ba103b8be611070bb3c82
parent456fce748b6a9e4e41a5508621a002ceb3952416 (diff)
posix bug
-rw-r--r--init.lua3
1 files changed, 2 insertions, 1 deletions
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))