From d3eb8b8339b9f2aa1702cd6e38cc12448eff5882 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 15 Dec 2024 16:53:18 -0500 Subject: Have ask() return an optional text --- environment.c | 2 +- stdlib/stdlib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.c b/environment.c index cc7a92f6..af4c8530 100644 --- a/environment.c +++ b/environment.c @@ -43,7 +43,7 @@ env_t *new_compilation_unit(CORD libname) .default_val=FakeAST(Bool, true), .next=new(arg_t, .name="force_tty", .type=Type(BoolType), .default_val=FakeAST(Bool, true)))), - .ret=TEXT_TYPE)}}, + .ret=Type(OptionalType, TEXT_TYPE))}}, {"exit", {.code="tomo_exit", .type=Type(FunctionType, .args=new( arg_t, .name="message", .type=Type(OptionalType, .type=Type(TextType)), diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c index b4a1ad77..c7f1c13b 100644 --- a/stdlib/stdlib.c +++ b/stdlib/stdlib.c @@ -540,7 +540,7 @@ public _Noreturn void tomo_exit(Text_t text, int32_t status) public Text_t ask(Text_t prompt, bool bold, bool force_tty) { - Text_t ret = Text(""); + OptionalText_t ret = NONE_TEXT; FILE *out = stdout; FILE *in = stdin; -- cgit v1.2.3