hautils

[hare] Set of POSIX utilities
Log | Files | Refs | README | LICENSE

commit 91f8b07f71317f8b9982f89243509d3848a491df
parent f8a309c38b12bd100c581388997c2cc4110b2365
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 31 Aug 2023 15:22:39 +0200

all: fixes for upstream Hare updates

Diffstat:
Mhead.ha | 2+-
Mmain/main.ha | 2+-
Mnl.ha | 6+++---
Muniq.ha | 8++++----
Mwc.ha | 2+-
5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/head.ha b/head.ha @@ -40,7 +40,7 @@ export fn utilmain() (void | main::error) = { case let file: io::file => yield file; }; - static let buf: [os::BUFSIZ]u8 = [0...]; + static let buf: [os::BUFSZ]u8 = [0...]; const file = bufio::init(file, buf, []); match (head(&file, n)) { case void => void; diff --git a/main/main.ha b/main/main.ha @@ -24,7 +24,7 @@ export @symbol("main") fn main() void = { // Prints to stderr a flag error message if specified, then the program usage. // Exists the program with error code 1. -export @noreturn fn usage(help: []getopt::help, flags: rune...) void = { +export fn usage(help: []getopt::help, flags: rune...) never = { const progname = os::args[0]; if (len(flags) == 1) { diff --git a/nl.ha b/nl.ha @@ -113,7 +113,7 @@ export fn utilmain() (void | main::error) = { }; }; case 'd' => - const rs = strings::runes(opt.1); + const rs = strings::torunes(opt.1); defer free(rs); delim = switch (len(rs)) { case 1 => @@ -234,8 +234,8 @@ export fn utilmain() (void | main::error) = { fmt::fatalf("Error opening '{}': {}", cmd.args[0], fs::strerror(err)); case let file: io::file => - static const rbuf: [os::BUFSIZ]u8 = [0...]; - static const wbuf: [os::BUFSIZ]u8 = [0...]; + static const rbuf: [os::BUFSZ]u8 = [0...]; + static const wbuf: [os::BUFSZ]u8 = [0...]; yield &bufio::init(file, rbuf, wbuf); } else diff --git a/uniq.ha b/uniq.ha @@ -134,8 +134,8 @@ export fn utilmain() (main::error | void) = { }; }; - static const stdin_rbuf: [os::BUFSIZ]u8 = [0...]; - static const stdin_wbuf: [os::BUFSIZ]u8 = [0...]; + static const stdin_rbuf: [os::BUFSZ]u8 = [0...]; + static const stdin_wbuf: [os::BUFSZ]u8 = [0...]; if (len(cmd.args) >= 1 && cmd.args[0] != "-") { match (os::open(cmd.args[0])) { case let err: fs::error => @@ -147,8 +147,8 @@ export fn utilmain() (main::error | void) = { }; defer io::close(cfg.input)!; - static const stdout_rbuf: [os::BUFSIZ]u8 = [0...]; - static const stdout_wbuf: [os::BUFSIZ]u8 = [0...]; + static const stdout_rbuf: [os::BUFSZ]u8 = [0...]; + static const stdout_wbuf: [os::BUFSZ]u8 = [0...]; if (len(cmd.args) == 2) { match (os::create(cmd.args[1], 0o666, fs::flag::WRONLY)) { case let err: fs::error => diff --git a/wc.ha b/wc.ha @@ -84,7 +84,7 @@ export fn utilmain() (main::error | void) = { }; fn count(in: io::handle, mode: items) (counts | main::error) = { - static let buf: [os::BUFSIZ]u8 = [0...]; + static let buf: [os::BUFSZ]u8 = [0...]; let result = counts { ... }; for (true) { const n = match (io::read(in, buf[..])?) {