fixing angry bug
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 5 Dec 2020 21:36:21 +0000 (15:36 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 5 Dec 2020 21:36:21 +0000 (15:36 -0600)
core/string.onyx
core/wasi.onyx

index 0014c7c1b1fa3e2999d5d25a327414944470f5d9..f6ede261cddd97c7274e472cf8fb35fc59cc173a 100644 (file)
@@ -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) {
index 128cbe4da537f1798c16053d07afd51944f5ff1d..a35632523bcba01de6f9eda8277696de651b848d 100644 (file)
@@ -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;