From b088ce950b0551583aa9ab61764e7d5d102843a5 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sat, 5 Dec 2020 15:36:21 -0600 Subject: [PATCH] fixing angry bug --- core/string.onyx | 5 +++++ core/wasi.onyx | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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; -- 2.25.1