diff options
author | glenda <glenda@cirno> | 2022-09-12 08:51:32 +0000 |
---|---|---|
committer | glenda <glenda@cirno> | 2022-09-12 08:51:32 +0000 |
commit | a730f5c5dd9fc7c97bb50024f01a407bc6bc7be8 (patch) | |
tree | 40cc6829a605d002cf7fe587eed1acf10e8f2e7d /main.c | |
parent | 8d8e6ce78cfdf9ffac4dce4cd6605e37d64120ed (diff) |
Handle lines with no code in the session
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -50,8 +50,11 @@ restart: while(!off){ checkmem("main loop"); Datum *result = evalline(nil, stdin, 1); - if(result) - outputmain(result); + if(!result){ + result = allocdatum(ArrayTag, 1); + result->array = mkscalarint(0); + } + outputmain(result); freedatum(result); /* print("Unfreed arrays: %d\n", arrayalloccounts); |