summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-10-12 14:38:24 -0700
committerOri Bernstein <ori@eigenstate.org>2018-10-12 14:39:56 -0700
commit7d4e8b50cac2af2cce372bfbebc3addc752eab25 (patch)
tree59b844b63808f973ad7c5e928ff33b1aaea32135
parent2a9a9eba576c0932b7828fda9995a2335e789b2f (diff)
downloadmc-7d4e8b50cac2af2cce372bfbebc3addc752eab25.tar.gz
Don't readinto if we're dropping.
-rw-r--r--lib/bio/bio.myr6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bio/bio.myr b/lib/bio/bio.myr
index f5ce61b..eb55069 100644
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -422,7 +422,11 @@ const readdelim = {f, delim, drop
* delimiter at the end. If we're at 0 bytes even
* then, return an eof.
*/
- readinto(f, &ret, f.rend - f.rstart)
+ if drop
+ f.rstart += f.rend - f.rstart
+ else
+ readinto(f, &ret, f.rend - f.rstart)
+ ;;
match ret.len
| 0: -> `std.Err `Eof
| _: -> `std.Ok ret