hautils

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2f4ac4d842041e9c009f9964483e62351ea42222
parent 03b3cd0618624f01514ace79b0b98eb8d8eb4b03
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun,  2 Jan 2022 15:23:19 +0100

Updates per bufio changes

Diffstat:
Mhead.ha | 3+--
Mnl.ha | 4++--
2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/head.ha b/head.ha @@ -40,8 +40,7 @@ export fn utilmain() (void | main::error) = { defer io::close(file); static let buf: [os::BUFSIZ]u8 = [0...]; const file = bufio::buffered(file, buf, []); - defer io::close(file); - head(file, n)?; + head(&file, n)?; }; }; diff --git a/nl.ha b/nl.ha @@ -169,7 +169,7 @@ export fn utilmain() (void | main::error) = { }; const use_file = len(cmd.args) == 1 && cmd.args[0] != "-"; - const input = if (use_file) + const input: io::handle = if (use_file) match (os::open(cmd.args[0])) { case let err: fs::error => fmt::fatal("Error opening '{}': {}", @@ -177,7 +177,7 @@ export fn utilmain() (void | main::error) = { case let file: io::file => static const rbuf: [os::BUFSIZ]u8 = [0...]; static const wbuf: [os::BUFSIZ]u8 = [0...]; - yield bufio::buffered(file, rbuf, wbuf); + yield &bufio::buffered(file, rbuf, wbuf); } else os::stdin;