about summary refs log tree commit diff
path: root/executor.c
diff options
context:
space:
mode:
authorNakidai <nakidai@disroot.org>2025-03-26 21:02:40 +0300
committerNakidai <nakidai@disroot.org>2025-03-26 21:02:40 +0300
commit11ffd33053b157e3ee70b46080501fa637c0f84d (patch)
treeb978e32c19bb323bd458d6e5f6c88840324c1841 /executor.c
parente5e13e8063edb3f7841de6c63d706cf0269dbf84 (diff)
download3cl-11ffd33053b157e3ee70b46080501fa637c0f84d.tar.gz
3cl-11ffd33053b157e3ee70b46080501fa637c0f84d.zip
Allow EOF
Diffstat (limited to 'executor.c')
-rw-r--r--executor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/executor.c b/executor.c
index 993870a..0542a9c 100644
--- a/executor.c
+++ b/executor.c
@@ -220,7 +220,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab
             errx(1, "Cannot save input in a non-existent variable %c", code->value);
 
         int c = getchar();
-        if (c < 0)
+        if (c < 0 && ferror(stdin))
             err(1, "getchar()");
 
         *p = c;