summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bio/bio.myr7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/bio/bio.myr b/lib/bio/bio.myr
index 62cca13..18982f3 100644
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -427,7 +427,7 @@ const readdelim = {f, delim, mode
for i = f.rstart; i <= f.rend - delim.len; i++
for j = 0; j < delim.len; j++
if f.rbuf[i + j] != delim[j]
- goto notfound
+ goto nextiter
;;
;;
/* If we found it, return that information */
@@ -438,12 +438,11 @@ const readdelim = {f, delim, mode
;;
f.rstart += delim.len
-> `std.Ok ret
-:notfound
- f.rstart = i
+:nextiter
;;
match mode
| `Drop: f.rstart = i
- | `Read: readinto(f, &ret, f.rend - f.rstart)
+ | `Read: readinto(f, &ret, i - f.rstart)
| `Keep:
;;
;;