summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-19 20:46:03 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-19 20:46:03 -0400
commitc464f4b8cc56ae10e8f053efc6ec8b7e9989d4df (patch)
tree7987a11553fe63609e50fa1e11beecad1579132f
parent5fc8fe7bec594a98c7a2b9fbdfc5f7fb4f11c7c9 (diff)
downloadmc-c464f4b8cc56ae10e8f053efc6ec8b7e9989d4df.tar.gz
Fix dir-linux to actually keep the offset.
-rw-r--r--libstd/dir-linux.myr5
1 files changed, 3 insertions, 2 deletions
diff --git a/libstd/dir-linux.myr b/libstd/dir-linux.myr
index 389d160..e294969 100644
--- a/libstd/dir-linux.myr
+++ b/libstd/dir-linux.myr
@@ -20,6 +20,8 @@ pkg std =
const dirclose : (d : dir# -> void)
;;
+const Direntoverhead = 20
+
const diropen = {p
var fd
var dir
@@ -33,7 +35,6 @@ const diropen = {p
-> `Ok dir
}
-
const dirread = {d
var len
var dent
@@ -49,7 +50,7 @@ const dirread = {d
;;
dent = &d.buf[d.off] castto(dirent64#)
- namelen = (dent.reclen - 20) castto(size)
+ namelen = (dent.reclen - Direntoverhead) castto(size)
d.off += dent.reclen castto(int64)
-> `Some sldup(dent.name[:namelen])
}