about summary refs log tree commit diff stats
path: root/src/loader/loaderhandle.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-15 23:25:53 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-15 23:26:09 +0100
commit245609d564855a0e4b43066ff863919a4d7a19ff (patch)
treebf24ee5a45b27e2f89efee1032237c12545591bd /src/loader/loaderhandle.nim
parent345b515fdefe53a8cd80defdaa10d6d7696805fe (diff)
downloadchawan-245609d564855a0e4b43066ff863919a4d7a19ff.tar.gz
loader: fix crash on file redirection inputs
cha -d <some-file was crashing loader, because it was trying to register
the regular file in the selector.

this patch fixes the problem, but the control flow of loader looks like
spaghetti now
Diffstat (limited to 'src/loader/loaderhandle.nim')
-rw-r--r--src/loader/loaderhandle.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/loader/loaderhandle.nim b/src/loader/loaderhandle.nim
index b0c5747e..11a97bf4 100644
--- a/src/loader/loaderhandle.nim
+++ b/src/loader/loaderhandle.nim
@@ -149,6 +149,7 @@ proc sendData*(ps: PosixStream, buffer: LoaderBuffer, si = 0): int {.inline.} =
 
 proc close*(handle: LoaderHandle) =
   for output in handle.outputs:
+    #TODO assert not output.registered
     assert output.sostream == nil
     if output.ostream != nil:
       output.ostream.close()