summaryrefslogtreecommitdiff
path: root/lib/bio
diff options
context:
space:
mode:
authorCarlin Bingham <cb@viennan.net>2018-02-02 02:42:50 +1300
committerCarlin Bingham <cb@viennan.net>2018-02-02 02:42:50 +1300
commit066812db79f10a3cdee5268ad7214bacb44d2eef (patch)
treed6fafd73898a972cc7474c7b63115d9cc4fe6270 /lib/bio
parentfcfba8c44c5ee110b7b5fd86d752fdeec33eeb0b (diff)
downloadmc-066812db79f10a3cdee5268ad7214bacb44d2eef.tar.gz
Fix std.skipto
It would only skip past however many characters the delimeter was and would hang if the delimeter wasn't found before eof
Diffstat (limited to 'lib/bio')
-rw-r--r--lib/bio/bio.myr6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bio/bio.myr b/lib/bio/bio.myr
index 1f44bf8..483662a 100644
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -410,6 +410,8 @@ const readdelim = {f, delim, drop
| `std.Err `Eof:
if !drop
ret = readinto(f, ret, f.rend - f.rstart)
+ else
+ f.rstart += f.rend - f.rstart
;;
if ret.len > 0
-> `std.Ok ret
@@ -428,6 +430,8 @@ const readdelim = {f, delim, drop
;;
if !drop
ret = readinto(f, ret, i - f.rstart)
+ else
+ f.rstart += i - f.rstart
;;
f.rstart += delim.len
-> `std.Ok ret
@@ -436,6 +440,8 @@ const readdelim = {f, delim, drop
;;
if !drop
ret = readinto(f, ret, f.rend - f.rstart)
+ else
+ f.rstart += f.rend - f.rstart
;;
;;
std.die("unreachable")