hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 76af771721b0fc611633b2c97b1f0e9bfdcb33e7
parent af8020521db555fd4e7b03ba849531c119ae362c
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun,  7 Nov 2021 11:59:18 +0100

cmd/haredoc: fix case where PAGER is unset

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mcmd/haredoc/main.ha | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/cmd/haredoc/main.ha b/cmd/haredoc/main.ha @@ -211,17 +211,17 @@ fn init_tty(ctx: *context) io::handle = { return os::stdout; }; case void => - match (exec::cmd("less")) { + yield match (exec::cmd("less")) { case cmd: exec::command => yield cmd; - case exec::error => void; - }; - match (exec::cmd("more")) { - case cmd: exec::command => - yield cmd; - case exec::error => void; + case exec::error => + yield match (exec::cmd("more")) { + case cmd: exec::command => + yield cmd; + case exec::error => + return os::stdout; + }; }; - return os::stdout; }; const pipe = unix::pipe()!;