From: Brendan Hansen Date: Sat, 5 Dec 2020 21:36:21 +0000 (-0600) Subject: fixing angry bug X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=b088ce950b0551583aa9ab61764e7d5d102843a5;p=onyx.git fixing angry bug --- diff --git a/core/string.onyx b/core/string.onyx index 0014c7c1..f6ede261 100644 --- a/core/string.onyx +++ b/core/string.onyx @@ -329,6 +329,11 @@ string_read_line :: proc (str: ^string, out: ^string) { str.data += out.count; str.count -= out.count; + + if str.count > 0 { + str.data += 1; + str.count -= 1; + } } string_advance_line :: proc (str: ^string) { diff --git a/core/wasi.onyx b/core/wasi.onyx index 128cbe4d..a3563252 100644 --- a/core/wasi.onyx +++ b/core/wasi.onyx @@ -223,7 +223,15 @@ FileStat :: struct { dev : Device; ino : INode; filetype : Filetype; - nlink : LinkCount; + + // ANGER(Brendan Hansen): I give the worst documentation in + // the entire world award to WASI, whose best documentation + // is a C header file, that is itself incorrect. nlink does + // not exist in the current version of wasmtime, and should + // not be here, but maybe in the future? Ugh. + // - brendanfh 2020/12/05 + // nlink : LinkCount; + size : Filesize; atim : Timestamp; mtim : Timestamp;