summaryrefslogtreecommitdiff
path: root/lib/std/slurp.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-20 22:02:21 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-20 22:26:18 -0800
commitc694d9a9c3f8c78837cf3bcbbe11fb19d04c204d (patch)
tree0f3c4d88df4e929d9c9fba5ff7646ec3fb056518 /lib/std/slurp.myr
parentd91d1e446ded81fba2452731ed40fec6e9a3be30 (diff)
downloadmc-c694d9a9c3f8c78837cf3bcbbe11fb19d04c204d.tar.gz
Put labels into scopes.
Diffstat (limited to 'lib/std/slurp.myr')
-rw-r--r--lib/std/slurp.myr5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/std/slurp.myr b/lib/std/slurp.myr
index 534baf9..576c39e 100644
--- a/lib/std/slurp.myr
+++ b/lib/std/slurp.myr
@@ -33,10 +33,9 @@ const fslurp = {fd
buf = slalloc(bufsz)
while true
match read(fd, buf[len:])
+ | `Ok 0:
+ -> `Ok buf[:len]
| `Ok n:
- if n == 0
- -> `Ok buf[:len]
- ;;
len += n
bufsz *= 2
buf = slgrow(buf, bufsz)