[MLton] A bug in the Posix_FileSys_Dirstream_readDir

Kostirya <[email protected]> Fri, 18 Oct 2019 14:42:22 +0300
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <CAG+QnTe-feQsPce8CPLdXZkmus2NseiBkbp_92G1Obw1qznX2Q@mail.gmail.com>
Hello.
I found a bug in the Posix_FileSys_Dirstream_readDir function
(file runtime/basis/Posix/FileSys/Dirstream.c).

e->d_name is not C string.

We must look on d_namlen field of struct dirent.

Let's do so that Posix_FileSys_Dirstream_readDir return d_name and
d_namlen pointer as arguments.

Thanks.